Class: Kentaa::Api::Resources::Contact
- Inherits:
-
Object
- Object
- Kentaa::Api::Resources::Contact
- Defined in:
- lib/kentaa/api/resources/contact.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #address ⇒ Object
- #address2 ⇒ Object
- #avatar_url ⇒ Object
- #birthday ⇒ Object
- #city ⇒ Object
- #country ⇒ Object
- #email ⇒ Object
- #first_name ⇒ Object
- #gender ⇒ Object
- #house_number ⇒ Object
- #house_number_addition ⇒ Object
- #infix ⇒ Object
-
#initialize(data) ⇒ Contact
constructor
A new instance of Contact.
- #last_name ⇒ Object
- #locale ⇒ Object
- #name ⇒ Object
- #phone ⇒ Object
- #street ⇒ Object
- #zipcode ⇒ Object
Constructor Details
#initialize(data) ⇒ Contact
Returns a new instance of Contact.
9 10 11 |
# File 'lib/kentaa/api/resources/contact.rb', line 9 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/kentaa/api/resources/contact.rb', line 7 def data @data end |
Instance Method Details
#address ⇒ Object
37 38 39 |
# File 'lib/kentaa/api/resources/contact.rb', line 37 def address data[:address] end |
#address2 ⇒ Object
41 42 43 |
# File 'lib/kentaa/api/resources/contact.rb', line 41 def address2 data[:address2] end |
#avatar_url ⇒ Object
33 34 35 |
# File 'lib/kentaa/api/resources/contact.rb', line 33 def avatar_url data[:avatar_url] end |
#birthday ⇒ Object
73 74 75 |
# File 'lib/kentaa/api/resources/contact.rb', line 73 def birthday Date.parse(data[:birthday]) if data[:birthday] end |
#city ⇒ Object
61 62 63 |
# File 'lib/kentaa/api/resources/contact.rb', line 61 def city data[:city] end |
#country ⇒ Object
65 66 67 |
# File 'lib/kentaa/api/resources/contact.rb', line 65 def country data[:country] end |
#email ⇒ Object
29 30 31 |
# File 'lib/kentaa/api/resources/contact.rb', line 29 def email data[:email] end |
#first_name ⇒ Object
13 14 15 |
# File 'lib/kentaa/api/resources/contact.rb', line 13 def first_name data[:first_name] end |
#gender ⇒ Object
77 78 79 |
# File 'lib/kentaa/api/resources/contact.rb', line 77 def gender data[:gender] end |
#house_number ⇒ Object
49 50 51 |
# File 'lib/kentaa/api/resources/contact.rb', line 49 def house_number data[:house_number] end |
#house_number_addition ⇒ Object
53 54 55 |
# File 'lib/kentaa/api/resources/contact.rb', line 53 def house_number_addition data[:house_number_addition] end |
#infix ⇒ Object
17 18 19 |
# File 'lib/kentaa/api/resources/contact.rb', line 17 def infix data[:infix] end |
#last_name ⇒ Object
21 22 23 |
# File 'lib/kentaa/api/resources/contact.rb', line 21 def last_name data[:last_name] end |
#locale ⇒ Object
81 82 83 |
# File 'lib/kentaa/api/resources/contact.rb', line 81 def locale data[:locale] end |
#name ⇒ Object
25 26 27 |
# File 'lib/kentaa/api/resources/contact.rb', line 25 def name [first_name, infix, last_name].reject { |s| s.to_s.empty? }.join(' ') end |
#phone ⇒ Object
69 70 71 |
# File 'lib/kentaa/api/resources/contact.rb', line 69 def phone data[:phone] end |
#street ⇒ Object
45 46 47 |
# File 'lib/kentaa/api/resources/contact.rb', line 45 def street data[:street] end |
#zipcode ⇒ Object
57 58 59 |
# File 'lib/kentaa/api/resources/contact.rb', line 57 def zipcode data[:zipcode] end |