Class: Alchemist::ModuleBuilder
- Inherits:
-
Object
- Object
- Alchemist::ModuleBuilder
- Defined in:
- lib/alchemist/module_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(category) ⇒ ModuleBuilder
constructor
A new instance of ModuleBuilder.
Constructor Details
#initialize(category) ⇒ ModuleBuilder
Returns a new instance of ModuleBuilder.
3 4 5 |
# File 'lib/alchemist/module_builder.rb', line 3 def initialize category @category = category end |
Instance Method Details
#build ⇒ Object
7 8 9 10 11 12 |
# File 'lib/alchemist/module_builder.rb', line 7 def build Module.new.tap do |category_module| category_module.class_eval %(def self.inspect() "#<Module(#{category})>" end) category_module.class_eval category_methods end end |