Class: Infostrada::PersonInfo
- Inherits:
-
BaseRequest
- Object
- BaseRequest
- Infostrada::PersonInfo
- Defined in:
- lib/infostrada/person_info.rb
Constant Summary collapse
- URL =
'/GetPersonInfo'
Constants inherited from BaseRequest
Instance Attribute Summary collapse
-
#birth_city ⇒ Object
Returns the value of attribute birth_city.
-
#birth_country ⇒ Object
Returns the value of attribute birth_country.
-
#birthdate ⇒ Object
Returns the value of attribute birthdate.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#public_name ⇒ Object
Returns the value of attribute public_name.
-
#weight ⇒ Object
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, info) ⇒ PersonInfo
constructor
A new instance of PersonInfo.
Methods inherited from BaseRequest
Constructor Details
#initialize(id, info) ⇒ PersonInfo
Returns a new instance of PersonInfo.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/infostrada/person_info.rb', line 18 def initialize(id, info) @id = id # Sometimes info comes as an empty array... return unless info && !info.empty? @first_name = info['c_FirstName'] @last_name = info['c_LastName'] @public_name = info['c_PublicName'] @nickname = info['c_Nickname'] @birthdate = Formatter.format_date(info['d_BirthDate']) @height = info['n_Height'] @weight = info['n_Weight'] @birth_city = info['c_BirthCity'] @birth_country = info['c_BirthCountry'] end |
Instance Attribute Details
#birth_city ⇒ Object
Returns the value of attribute birth_city.
8 9 10 |
# File 'lib/infostrada/person_info.rb', line 8 def birth_city @birth_city end |
#birth_country ⇒ Object
Returns the value of attribute birth_country.
8 9 10 |
# File 'lib/infostrada/person_info.rb', line 8 def birth_country @birth_country end |
#birthdate ⇒ Object
Returns the value of attribute birthdate.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def birthdate @birthdate end |
#first_name ⇒ Object
Returns the value of attribute first_name.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def first_name @first_name end |
#height ⇒ Object
Returns the value of attribute height.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def last_name @last_name end |
#nickname ⇒ Object
Returns the value of attribute nickname.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def nickname @nickname end |
#public_name ⇒ Object
Returns the value of attribute public_name.
7 8 9 |
# File 'lib/infostrada/person_info.rb', line 7 def public_name @public_name end |
#weight ⇒ Object
Returns the value of attribute weight.
8 9 10 |
# File 'lib/infostrada/person_info.rb', line 8 def weight @weight end |
Class Method Details
.where(options) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/infostrada/person_info.rb', line 10 def self.where() id = .delete(:person_id) info = get!(URL, query: { personid: id }).first new(id, info) end |