Class: Fotolia::Medium::CompImage

Inherits:
Object
  • Object
show all
Defined in:
lib/fotolia/medium.rb

Overview

I never got to know what a CompImage should be, least Fotolia’s API has a method to get one for a medium. So this is a class holding the info that method returns.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ CompImage

Returns a new instance of CompImage.



85
86
87
88
89
# File 'lib/fotolia/medium.rb', line 85

def initialize(attributes)
  @url = attributes['url']
  @width = attributes['width']
  @height = attributes['height']
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



83
84
85
# File 'lib/fotolia/medium.rb', line 83

def height
  @height
end

#urlObject (readonly)

Returns the value of attribute url.



83
84
85
# File 'lib/fotolia/medium.rb', line 83

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



83
84
85
# File 'lib/fotolia/medium.rb', line 83

def width
  @width
end

Class Method Details

.find(medium) ⇒ Object



91
92
93
# File 'lib/fotolia/medium.rb', line 91

def self.find(medium)
  CompImage.new(medium.fotolia.remote_call('getMediaComp', medium.id))
end