Class: OpenCongressApi::Type::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/opencongress_api/type/person.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(person = {}) ⇒ Person

Returns a new instance of Person.



6
7
8
# File 'lib/opencongress_api/type/person.rb', line 6

def initialize(person = {})
  self.person = person
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args) ⇒ Object



10
11
12
# File 'lib/opencongress_api/type/person.rb', line 10

def method_missing(id, *args)
  return self.person[id.id2name]
end

Instance Attribute Details

#personObject

Returns the value of attribute person.



4
5
6
# File 'lib/opencongress_api/type/person.rb', line 4

def person
  @person
end