Class: Philiprehberger::TestFactory::TransientCollector
- Inherits:
-
Object
- Object
- Philiprehberger::TestFactory::TransientCollector
- Defined in:
- lib/philiprehberger/test_factory/definition_proxy.rb
Overview
Collects transient attribute declarations via method_missing.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
readonly
Collected attributes.
Instance Method Summary collapse
-
#initialize ⇒ TransientCollector
constructor
A new instance of TransientCollector.
Constructor Details
#initialize ⇒ TransientCollector
Returns a new instance of TransientCollector.
64 65 66 |
# File 'lib/philiprehberger/test_factory/definition_proxy.rb', line 64 def initialize @attributes = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
70 71 72 73 74 75 76 |
# File 'lib/philiprehberger/test_factory/definition_proxy.rb', line 70 def method_missing(name, *args) if args.length == 1 @attributes[name] = args.first else super end end |
Instance Attribute Details
#attributes ⇒ Hash (readonly)
Returns collected attributes.
62 63 64 |
# File 'lib/philiprehberger/test_factory/definition_proxy.rb', line 62 def attributes @attributes end |