Class: VcsClient::Person
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#address ⇒ Object
Returns the value of attribute address.
-
#cong_dist ⇒ Object
Returns the value of attribute cong_dist.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#party ⇒ Object
Returns the value of attribute party.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#precinct ⇒ Object
Returns the value of attribute precinct.
-
#references ⇒ Object
Returns the value of attribute references.
-
#sex ⇒ Object
Returns the value of attribute sex.
-
#univ ⇒ Object
Returns the value of attribute univ.
Instance Method Summary collapse
Methods inherited from Basement
Constructor Details
This class inherits a constructor from VcsClient::Basement
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def actions @actions end |
#address ⇒ Object
Returns the value of attribute address.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def address @address end |
#cong_dist ⇒ Object
Returns the value of attribute cong_dist.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def cong_dist @cong_dist end |
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def date_of_birth @date_of_birth end |
#first_name ⇒ Object
Returns the value of attribute first_name.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def last_name @last_name end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def middle_name @middle_name end |
#party ⇒ Object
Returns the value of attribute party.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def party @party end |
#phone ⇒ Object
Returns the value of attribute phone.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def phone @phone end |
#precinct ⇒ Object
Returns the value of attribute precinct.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def precinct @precinct end |
#references ⇒ Object
Returns the value of attribute references.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def references @references end |
#sex ⇒ Object
Returns the value of attribute sex.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def sex @sex end |
#univ ⇒ Object
Returns the value of attribute univ.
7 8 9 |
# File 'lib/objects/person.rb', line 7 def univ @univ end |
Instance Method Details
#age ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/objects/person.rb', line 31 def age if date_of_birth date = Date.today day_diff = date.day - date_of_birth.day month_diff = date.month - date_of_birth.month - (day_diff < 0 ? 1 : 0) date.year - date_of_birth.year - (month_diff < 0 ? 1 : 0) end end |
#name ⇒ Object
40 41 42 43 44 45 |
# File 'lib/objects/person.rb', line 40 def name if @name.nil? @name = [self.first_name, self.middle_name, self.last_name].compact.join(' ') end @name end |
#token ⇒ Object
17 18 19 20 21 |
# File 'lib/objects/person.rb', line 17 def token if self.actions && self.actions.key?("checkin") self.actions["checkin"].url.split('/').last end end |