Class: LetterGenerator::Addressee

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/letter_generator/addressee.rb', line 3

def data
  @data
end