Class: Gastly::Image
- Inherits:
-
Object
- Object
- Gastly::Image
- Defined in:
- lib/gastly/image.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
-
#format(ext) ⇒ MiniMagick::Image
Instance.
-
#initialize(image) ⇒ Image
constructor
A new instance of Image.
- #resize(width:, height:) ⇒ Object
-
#save(output) ⇒ String
Full path to image.
Constructor Details
#initialize(image) ⇒ Image
Returns a new instance of Image.
6 7 8 |
# File 'lib/gastly/image.rb', line 6 def initialize(image) @image = image end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
3 4 5 |
# File 'lib/gastly/image.rb', line 3 def image @image end |
Instance Method Details
#format(ext) ⇒ MiniMagick::Image
Returns Instance.
19 20 21 |
# File 'lib/gastly/image.rb', line 19 def format(ext) image.format(ext) end |
#resize(width:, height:) ⇒ Object
12 13 14 15 |
# File 'lib/gastly/image.rb', line 12 def resize(width:, height:) dimensions = "#{width}x#{height}" image.resize(dimensions) end |
#save(output) ⇒ String
Returns Full path to image.
25 26 27 28 |
# File 'lib/gastly/image.rb', line 25 def save(output) image.write(output) output end |