Dynamically 'including' module methods possible?

Discussion in 'Ruby' started by C Cole, Jul 1, 2011.

  1. C Cole

    C Cole Guest

    I've got a number of modules defined in a particular folder that I would like to automatically have 'included' in a class, instead of having to hard-code 'include' statements for each one. Is this possible?

    a_folder
    > 1_module.rb
    > 2_module.rb
    > 3_module.rb
    > ..


    Somewhat repeating myself: When the class is initially loaded, I'd like it to dynamically compile a list of the modules in a particular folder that will then be individually included.

    Thanks.
     
    C Cole, Jul 1, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ferenc Engard
    Replies:
    2
    Views:
    113
    Ferenc Engard
    Dec 31, 2003
  2. Zev Blut
    Replies:
    3
    Views:
    173
    trans. (T. Onoma)
    Nov 24, 2004
  3. Nikita Petrov
    Replies:
    2
    Views:
    114
    Gary Wright
    Apr 6, 2008
  4. Kenny
    Replies:
    4
    Views:
    143
    Daniel Berger
    Jan 8, 2009
  5. Prince Nez
    Replies:
    3
    Views:
    249
    Robert Klemme
    Aug 18, 2009
Loading...

Share This Page