Class: Escpos::ImageProcessors::Base
- Inherits:
-
Object
- Object
- Escpos::ImageProcessors::Base
- Defined in:
- lib/escpos/image_processors/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#assert_dimensions_multiple_of_8! ⇒ Object
Require correct dimensions if auto resizing is not enabled.
-
#initialize(image_or_path, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(image_or_path, options = {}) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/escpos/image_processors/base.rb', line 7 def initialize(image_or_path, = {}) @options = end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
5 6 7 |
# File 'lib/escpos/image_processors/base.rb', line 5 def image @image end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/escpos/image_processors/base.rb', line 5 def @options end |
Instance Method Details
#assert_dimensions_multiple_of_8! ⇒ Object
Require correct dimensions if auto resizing is not enabled
13 14 15 16 17 18 19 |
# File 'lib/escpos/image_processors/base.rb', line 13 def assert_dimensions_multiple_of_8! unless .fetch(:extent, false) unless image.width % 8 == 0 && image.height % 8 == 0 raise DimensionsMustBeMultipleOf8 end end end |