Class: AssetHost::AssetSize
- Inherits:
-
Object
- Object
- AssetHost::AssetSize
- Defined in:
- lib/asset_host/asset_size.rb
Instance Attribute Summary collapse
-
#asset ⇒ Object
Returns the value of attribute asset.
-
#height ⇒ Object
Returns the value of attribute height.
-
#output ⇒ Object
Returns the value of attribute output.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#url ⇒ Object
Returns the value of attribute url.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(asset, output) ⇒ AssetSize
constructor
A new instance of AssetSize.
Constructor Details
#initialize(asset, output) ⇒ AssetSize
Returns a new instance of AssetSize.
5 6 7 8 9 10 11 12 13 |
# File 'lib/asset_host/asset_size.rb', line 5 def initialize(asset, output) @asset = asset @output = output self.width = @asset.json['sizes'][ output['code'] ]['width'] self.height = @asset.json['sizes'][ output['code'] ]['height'] self.tag = @asset.json['tags'][ output['code'] ] self.url = @asset.json['urls'][ output['code'] ] end |
Instance Attribute Details
#asset ⇒ Object
Returns the value of attribute asset.
3 4 5 |
# File 'lib/asset_host/asset_size.rb', line 3 def asset @asset end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/asset_host/asset_size.rb', line 3 def height @height end |
#output ⇒ Object
Returns the value of attribute output.
3 4 5 |
# File 'lib/asset_host/asset_size.rb', line 3 def output @output end |
#tag ⇒ Object
Returns the value of attribute tag.
3 4 5 |
# File 'lib/asset_host/asset_size.rb', line 3 def tag @tag end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/asset_host/asset_size.rb', line 3 def url @url end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/asset_host/asset_size.rb', line 3 def width @width end |