Class: Swiftly::Factory
- Inherits:
- BasicObject
- Defined in:
- lib/swiftly/factory.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize ⇒ Factory
constructor
A new instance of Factory.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Factory
Returns a new instance of Factory.
10 11 12 13 14 |
# File 'lib/swiftly/factory.rb', line 10 def initialize @attributes = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/swiftly/factory.rb', line 16 def method_missing(name, *args, &block) @attributes[name] = args[0] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
8 9 10 |
# File 'lib/swiftly/factory.rb', line 8 def attributes @attributes end |