Class: Blingee::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/blingee/image.rb

Overview

Simple container for holding the attributes of an image (height, width, and url).

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject (readonly)

Returns the value of attribute height.



9
10
11
# File 'lib/blingee/image.rb', line 9

def height
  @height
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/blingee/image.rb', line 9

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



9
10
11
# File 'lib/blingee/image.rb', line 9

def width
  @width
end