Class: PetfinderV2::Serializers::Photos

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Photos



9
10
11
12
13
14
# File 'lib/petfinder_V2/serializers/photos.rb', line 9

def initialize(data)
  @small = data['small']
  @medium = data['medium']
  @large = data['large']
  @full = data['full']
end

Instance Attribute Details

#fullObject (readonly)

Returns the value of attribute full.



8
9
10
# File 'lib/petfinder_V2/serializers/photos.rb', line 8

def full
  @full
end

#largeObject (readonly)

Returns the value of attribute large.



8
9
10
# File 'lib/petfinder_V2/serializers/photos.rb', line 8

def large
  @large
end

#mediumObject (readonly)

Returns the value of attribute medium.



8
9
10
# File 'lib/petfinder_V2/serializers/photos.rb', line 8

def medium
  @medium
end

#smallObject (readonly)

Returns the value of attribute small.



8
9
10
# File 'lib/petfinder_V2/serializers/photos.rb', line 8

def small
  @small
end

Class Method Details

.process_collection(collection) ⇒ Object



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

def self.process_collection(collection)
  collection.inject([]) { |mem, photos_hash| mem << new(photos_hash) }
end