Module: ModuleWithParams::ClassMethods

Defined in:
lib/module_with_params.rb

Instance Method Summary collapse

Instance Method Details

#[](*args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/module_with_params.rb', line 9

def [](*args)
  m = self
  name = m.name.split('::').last
  
  Module.new do
    include m
    define_method(:"_#{name}_module_options"){ (args.size == 1) ? args[0] : args }
  end
  
end