Class: FrenchMan::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/french_man.rb

Overview

Creates a new plan hash for merging with a blueprint

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject (readonly)

Returns the value of attribute hash.



63
64
65
# File 'lib/french_man.rb', line 63

def hash
  @hash
end