Class: PetfinderV2::Serializers::AnimalType
- Inherits:
-
Object
- Object
- PetfinderV2::Serializers::AnimalType
- Defined in:
- lib/petfinder_V2/serializers/animal_type.rb
Instance Attribute Summary collapse
-
#breeds_link ⇒ Object
readonly
Returns the value of attribute breeds_link.
-
#colors ⇒ Object
readonly
Returns the value of attribute colors.
-
#genders ⇒ Object
readonly
Returns the value of attribute genders.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ AnimalType
constructor
A new instance of AnimalType.
Constructor Details
#initialize(data) ⇒ AnimalType
10 11 12 13 14 15 16 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 10 def initialize(data) @name = data['name'] @colors = data['colors'] @genders = data['genders'] @link = data['_links']['self']['href'] @breeds_link = data['_links']['breeds']['href'] end |
Instance Attribute Details
#breeds_link ⇒ Object (readonly)
Returns the value of attribute breeds_link.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 4 def breeds_link @breeds_link end |
#colors ⇒ Object (readonly)
Returns the value of attribute colors.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 4 def colors @colors end |
#genders ⇒ Object (readonly)
Returns the value of attribute genders.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 4 def genders @genders end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 4 def link @link end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 4 def name @name end |
Class Method Details
.process_collection(data) ⇒ Object
6 7 8 |
# File 'lib/petfinder_V2/serializers/animal_type.rb', line 6 def self.process_collection(data) data['types'].map { |d| new(d) } end |