Class: Fabricas::CleanRoom
- Inherits:
- BasicObject
- Defined in:
- lib/fabricas.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#class_name ⇒ Object
Returns the value of attribute class_name.
Instance Method Summary collapse
- #factory(klass, args = {}, &block) ⇒ Object
-
#initialize(name) ⇒ CleanRoom
constructor
A new instance of CleanRoom.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ CleanRoom
Returns a new instance of CleanRoom.
49 50 51 52 |
# File 'lib/fabricas.rb', line 49 def initialize(name) @attributes = {} @class_name = name.is_a?(::String) ? name.downcase.to_sym : name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
54 55 56 |
# File 'lib/fabricas.rb', line 54 def method_missing(method_name, *args, &block) attributes[method_name] = args.first || block end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
47 48 49 |
# File 'lib/fabricas.rb', line 47 def attributes @attributes end |
#class_name ⇒ Object
Returns the value of attribute class_name.
47 48 49 |
# File 'lib/fabricas.rb', line 47 def class_name @class_name end |