Class: Kentaa::Api::Resources::Contact

Inherits:
Object
  • Object
show all
Defined in:
lib/kentaa/api/resources/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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

#addressObject



37
38
39
# File 'lib/kentaa/api/resources/contact.rb', line 37

def address
  data[:address]
end

#address2Object



41
42
43
# File 'lib/kentaa/api/resources/contact.rb', line 41

def address2
  data[:address2]
end

#avatar_urlObject



33
34
35
# File 'lib/kentaa/api/resources/contact.rb', line 33

def avatar_url
  data[:avatar_url]
end

#birthdayObject



73
74
75
# File 'lib/kentaa/api/resources/contact.rb', line 73

def birthday
  Date.parse(data[:birthday]) if data[:birthday]
end

#cityObject



61
62
63
# File 'lib/kentaa/api/resources/contact.rb', line 61

def city
  data[:city]
end

#countryObject



65
66
67
# File 'lib/kentaa/api/resources/contact.rb', line 65

def country
  data[:country]
end

#emailObject



29
30
31
# File 'lib/kentaa/api/resources/contact.rb', line 29

def email
  data[:email]
end

#first_nameObject



13
14
15
# File 'lib/kentaa/api/resources/contact.rb', line 13

def first_name
  data[:first_name]
end

#genderObject



77
78
79
# File 'lib/kentaa/api/resources/contact.rb', line 77

def gender
  data[:gender]
end

#house_numberObject



49
50
51
# File 'lib/kentaa/api/resources/contact.rb', line 49

def house_number
  data[:house_number]
end

#house_number_additionObject



53
54
55
# File 'lib/kentaa/api/resources/contact.rb', line 53

def house_number_addition
  data[:house_number_addition]
end

#infixObject



17
18
19
# File 'lib/kentaa/api/resources/contact.rb', line 17

def infix
  data[:infix]
end

#last_nameObject



21
22
23
# File 'lib/kentaa/api/resources/contact.rb', line 21

def last_name
  data[:last_name]
end

#localeObject



81
82
83
# File 'lib/kentaa/api/resources/contact.rb', line 81

def locale
  data[:locale]
end

#nameObject



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

#phoneObject



69
70
71
# File 'lib/kentaa/api/resources/contact.rb', line 69

def phone
  data[:phone]
end

#streetObject



45
46
47
# File 'lib/kentaa/api/resources/contact.rb', line 45

def street
  data[:street]
end

#zipcodeObject



57
58
59
# File 'lib/kentaa/api/resources/contact.rb', line 57

def zipcode
  data[:zipcode]
end