Class: Fotolia::Medium::License
- Inherits:
-
Object
- Object
- Fotolia::Medium::License
- Defined in:
- lib/fotolia/medium.rb
Overview
Represents a license in which Fotolia’s media are available.
See www.fotolia.com/Info/SizesAndUses for an overview of available licenses.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Instance Method Summary collapse
- #dpi ⇒ Object
- #height ⇒ Object
-
#initialize(medium, attributes) ⇒ License
constructor
A new instance of License.
- #phrase ⇒ Object
- #ratio ⇒ Object
- #width ⇒ Object
Constructor Details
#initialize(medium, attributes) ⇒ License
Returns a new instance of License.
30 31 32 33 34 |
# File 'lib/fotolia/medium.rb', line 30 def initialize(medium, attributes) @medium = medium @name = attributes['name'] @price = attributes['price'] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/fotolia/medium.rb', line 28 def name @name end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
28 29 30 |
# File 'lib/fotolia/medium.rb', line 28 def price @price end |
Instance Method Details
#dpi ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/fotolia/medium.rb', line 52 def dpi begin @dpi ||= @medium.details['licenses_details'][self.name]['dpi'] rescue nil end end |
#height ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/fotolia/medium.rb', line 44 def height begin @height ||= @medium.details['licenses_details'][self.name]['height'] rescue nil end end |
#phrase ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/fotolia/medium.rb', line 68 def phrase begin @phrase ||= @medium.details['licenses_details'][self.name]['phrase'] rescue nil end end |
#ratio ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/fotolia/medium.rb', line 60 def ratio begin @ratio ||= @medium.details['licenses_details'][self.name]['ratio'] rescue nil end end |
#width ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/fotolia/medium.rb', line 36 def width begin @width ||= @medium.details['licenses_details'][self.name]['width'] rescue nil end end |