Class: PetfinderV2::Serializers::Contact

Inherits:
Object
  • Object
show all
Defined in:
lib/petfinder_V2/serializers/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Contact



7
8
9
10
11
# File 'lib/petfinder_V2/serializers/contact.rb', line 7

def initialize(data)
  @data = data
  @phone = data['phone']
  @email = data['email']
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/petfinder_V2/serializers/contact.rb', line 6

def email
  @email
end

#phoneObject (readonly)

Returns the value of attribute phone.



6
7
8
# File 'lib/petfinder_V2/serializers/contact.rb', line 6

def phone
  @phone
end

Instance Method Details

#addressObject



13
14
15
# File 'lib/petfinder_V2/serializers/contact.rb', line 13

def address
  Address.new(@data['address'])
end