Class: LetterGenerator::Addressee
- Inherits:
-
Object
- Object
- LetterGenerator::Addressee
- Defined in:
- lib/letter_generator/addressee.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Addressee
constructor
A new instance of Addressee.
- #method_missing(*args) ⇒ Object
Constructor Details
#initialize(data) ⇒ Addressee
Returns a new instance of Addressee.
5 6 7 |
# File 'lib/letter_generator/addressee.rb', line 5 def initialize(data) @data = Hash(data) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
9 10 11 |
# File 'lib/letter_generator/addressee.rb', line 9 def method_missing(*args) data[args.flatten.first.to_sym] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/letter_generator/addressee.rb', line 3 def data @data end |