Class: Imaginable::Image
- Inherits:
-
Object
- Object
- Imaginable::Image
- Defined in:
- lib/imaginable/image.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(uuid, token, version) ⇒ Image
constructor
A new instance of Image.
- #url(options = {}) ⇒ Object
Constructor Details
#initialize(uuid, token, version) ⇒ Image
Returns a new instance of Image.
7 8 9 10 11 |
# File 'lib/imaginable/image.rb', line 7 def initialize(uuid, token, version) @uuid = uuid @token = token @version = version end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/imaginable/image.rb', line 5 def token @token end |
#uuid ⇒ Object
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/imaginable/image.rb', line 5 def uuid @uuid end |
Instance Method Details
#url(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/imaginable/image.rb', line 13 def url( = {}) [:width] ||= 0 [:format] ||= 'original' height = .has_key?(:height) ? "-#{[:height]}" : "" "#{Imaginable.scale_server}/image/#{@uuid}-#{@version}-#{[:format]}-#{[:width]}#{height}.jpg" end |