Class: PetfinderV2::Serializers::AnimalBreed

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/petfinder_V2/serializers/animal_breed.rb', line 4

def name
  @name
end

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