Class: MyRepresentatives::Person

Inherits:
Object
  • Object
show all
Includes:
Hashable
Defined in:
lib/my_representatives/person.rb

Defined Under Namespace

Classes: Error, IsNotAnElectorateObjectError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(electorate) ⇒ Person

Returns a new instance of Person.



14
15
16
17
18
# File 'lib/my_representatives/person.rb', line 14

def initialize(electorate)
  raise IsNotAnElectorateObjectError unless electorate && electorate.is_a?(Electorate)
  @electorate       = electorate
  @successful_merge = false
end

Instance Attribute Details

#electorateObject

Returns the value of attribute electorate.



11
12
13
# File 'lib/my_representatives/person.rb', line 11

def electorate
  @electorate
end

#emailObject

Returns the value of attribute email.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def first_name
  @first_name
end

#formal_nameObject

Returns the value of attribute formal_name.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def formal_name
  @formal_name
end

#genderObject

Returns the value of attribute gender.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def gender
  @gender
end

#homepage_urlObject

Returns the value of attribute homepage_url.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def homepage_url
  @homepage_url
end

#honorificsObject

Returns the value of attribute honorifics.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def honorifics
  @honorifics
end

#image_urlObject

Returns the value of attribute image_url.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def image_url
  @image_url
end

#last_nameObject

Returns the value of attribute last_name.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def last_name
  @last_name
end

#party_nameObject

Returns the value of attribute party_name.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def party_name
  @party_name
end

#phoneObject

Returns the value of attribute phone.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def phone
  @phone
end

#physical_addressObject

Returns the value of attribute physical_address.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def physical_address
  @physical_address
end

#postal_addressObject

Returns the value of attribute postal_address.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def postal_address
  @postal_address
end

#preferred_nameObject

Returns the value of attribute preferred_name.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def preferred_name
  @preferred_name
end

#salutationObject

Returns the value of attribute salutation.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def salutation
  @salutation
end

#successful_mergeObject

Returns the value of attribute successful_merge.



11
12
13
# File 'lib/my_representatives/person.rb', line 11

def successful_merge
  @successful_merge
end

#titleObject

Returns the value of attribute title.



12
13
14
# File 'lib/my_representatives/person.rb', line 12

def title
  @title
end

Instance Method Details

#to_hashObject



20
21
22
# File 'lib/my_representatives/person.rb', line 20

def to_hash
  super
end