Class: RiotCarrierwave::MagickWrapper
- Inherits:
-
Object
- Object
- RiotCarrierwave::MagickWrapper
- Defined in:
- lib/riot-carrierwave/wrappers.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(filename) ⇒ MagickWrapper
constructor
A new instance of MagickWrapper.
- #width ⇒ Object
Constructor Details
#initialize(filename) ⇒ MagickWrapper
Returns a new instance of MagickWrapper.
28 29 30 |
# File 'lib/riot-carrierwave/wrappers.rb', line 28 def initialize(filename) @image = ::Magick::Image.read(filename).first end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
23 24 25 |
# File 'lib/riot-carrierwave/wrappers.rb', line 23 def image @image end |
Instance Method Details
#height ⇒ Object
26 |
# File 'lib/riot-carrierwave/wrappers.rb', line 26 def height; image.rows; end |
#width ⇒ Object
25 |
# File 'lib/riot-carrierwave/wrappers.rb', line 25 def width; image.columns; end |