Class: FrenchMan::Plan
- Inherits:
-
Object
- Object
- FrenchMan::Plan
- Defined in:
- lib/french_man.rb
Overview
Creates a new plan hash for merging with a blueprint
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Plan
constructor
:nodoc:.
-
#method_missing(attribute, &block) ⇒ Object
:nodoc:.
Constructor Details
#initialize(&block) ⇒ Plan
:nodoc:
65 66 67 68 |
# File 'lib/french_man.rb', line 65 def initialize(&block) #:nodoc: @hash = {} instance_eval &block unless block.nil? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(attribute, &block) ⇒ Object
:nodoc:
70 71 72 |
# File 'lib/french_man.rb', line 70 def method_missing(attribute, &block) #:nodoc: @hash.merge!(attribute => block.call) end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
63 64 65 |
# File 'lib/french_man.rb', line 63 def hash @hash end |