Class: Wallbum::ImagePacking::Image
- Inherits:
-
Object
- Object
- Wallbum::ImagePacking::Image
- Defined in:
- lib/wallbum/image.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#img ⇒ Object
readonly
Returns the value of attribute img.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#rectangle ⇒ Object
Returns the value of attribute rectangle.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(path) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(path) ⇒ Image
Returns a new instance of Image.
13 14 15 16 17 18 |
# File 'lib/wallbum/image.rb', line 13 def initialize(path) @path = path @img = Magick::Image.read(path).first @width = @img.columns @height = @img.rows end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
9 10 11 |
# File 'lib/wallbum/image.rb', line 9 def height @height end |
#img ⇒ Object (readonly)
Returns the value of attribute img.
10 11 12 |
# File 'lib/wallbum/image.rb', line 10 def img @img end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/wallbum/image.rb', line 7 def path @path end |
#rectangle ⇒ Object
Returns the value of attribute rectangle.
11 12 13 |
# File 'lib/wallbum/image.rb', line 11 def rectangle @rectangle end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
8 9 10 |
# File 'lib/wallbum/image.rb', line 8 def width @width end |