#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    184
    Rep Power
    14

    Packages / Modules


    I was wondering if it was possible to deaclare a module / package that can exist acrossed seperate files.

    For example I have a set of sprite classes that should all be a part of the same module, but each sprite class is in a different file. Is it possible to declare them as being a member to a certain ruby module without putting them inside the module definition?
    --Tantapants
  2. #2
  3. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1050
    Yes. ruby allows this rather well, all you do is put them in the same module, despite their being in seperate files. So each file has

    ruby Code:
    module Mymodule
        #whatever
    end


    and it will automagically put them in the same module.

    You must still include the files seperately though.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    184
    Rep Power
    14
    I was going to test that first... Sorry for being such a lazy nut.

    Thanks though.
    --Tantapants

IMN logo majestic logo threadwatch logo seochat tools logo