Class: PetfinderV2::Serializers::Contact
- Inherits:
-
Object
- Object
- PetfinderV2::Serializers::Contact
- Defined in:
- lib/petfinder_V2/serializers/contact.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(data) ⇒ Contact
constructor
A new instance of Contact.
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
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'lib/petfinder_V2/serializers/contact.rb', line 6 def email @email end |
#phone ⇒ Object (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
#address ⇒ Object
13 14 15 |
# File 'lib/petfinder_V2/serializers/contact.rb', line 13 def address Address.new(@data['address']) end |