Class: PetfinderV2::Serializers::AnimalBreed
- Inherits:
-
Object
- Object
- PetfinderV2::Serializers::AnimalBreed
- Defined in:
- lib/petfinder_V2/serializers/animal_breed.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type_link ⇒ Object
Returns the value of attribute type_link.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ AnimalBreed
constructor
A new instance of AnimalBreed.
Constructor Details
#initialize(data) ⇒ AnimalBreed
10 11 12 13 |
# File 'lib/petfinder_V2/serializers/animal_breed.rb', line 10 def initialize(data) @name = data['name'] @type_link = data['_links']['type']['href'] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_breed.rb', line 4 def name @name end |
#type_link ⇒ Object
Returns the value of attribute type_link.
4 5 6 |
# File 'lib/petfinder_V2/serializers/animal_breed.rb', line 4 def type_link @type_link end |
Class Method Details
.process_collection(data) ⇒ Object
6 7 8 |
# File 'lib/petfinder_V2/serializers/animal_breed.rb', line 6 def self.process_collection(data) data['breeds'].map { |b| new(b) } end |