Class: Fruity::NamedBlockCollector
- Inherits:
-
Object
- Object
- Fruity::NamedBlockCollector
- Defined in:
- lib/fruity/named_block_collector.rb
Instance Method Summary collapse
-
#initialize(to_hash) ⇒ NamedBlockCollector
constructor
A new instance of NamedBlockCollector.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(to_hash) ⇒ NamedBlockCollector
Returns a new instance of NamedBlockCollector.
3 4 5 |
# File 'lib/fruity/named_block_collector.rb', line 3 def initialize(to_hash) @to_hash = to_hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
7 8 9 10 |
# File 'lib/fruity/named_block_collector.rb', line 7 def method_missing(method, *args, &block) super unless args.empty? @to_hash[method] = block end |