Class: Blingee::Image
- Inherits:
-
Object
- Object
- Blingee::Image
- Defined in:
- lib/blingee/image.rb
Overview
Simple container for holding the attributes of an image (height, width, and url).
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(attributes = {}) ⇒ Image
Returns a new instance of Image.
11 12 13 14 15 |
# File 'lib/blingee/image.rb', line 11 def initialize(attributes = {}) @height = attributes[:height].to_i @url = attributes[:url] @width = attributes[:width].to_i end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
9 10 11 |
# File 'lib/blingee/image.rb', line 9 def height @height end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/blingee/image.rb', line 9 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
9 10 11 |
# File 'lib/blingee/image.rb', line 9 def width @width end |