Class: Poleica::Converters::GraphicsMagick::ThumbnailOptionsGenerator
- Inherits:
-
Object
- Object
- Poleica::Converters::GraphicsMagick::ThumbnailOptionsGenerator
- Includes:
- Utils
- Defined in:
- lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb
Overview
Generate options for the GraphicsMagick to_thumbnail
Instance Attribute Summary collapse
-
#current_height ⇒ Object
readonly
Returns the value of attribute current_height.
-
#current_width ⇒ Object
readonly
Returns the value of attribute current_width.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#polei ⇒ Object
readonly
Returns the value of attribute polei.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(polei, options = {}) ⇒ ThumbnailOptionsGenerator
constructor
A new instance of ThumbnailOptionsGenerator.
Methods included from Utils
#bin_path, exec_with_timeout, extract_extension_and_options, fail_if_error, #host_os, init_process_std, #linux?, map_std, #osx?, #underscorize, #windows?
Constructor Details
#initialize(polei, options = {}) ⇒ ThumbnailOptionsGenerator
Returns a new instance of ThumbnailOptionsGenerator.
12 13 14 15 16 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 12 def initialize(polei, = {}) @polei = polei @options = .merge() @current_width, @current_height = identify end |
Instance Attribute Details
#current_height ⇒ Object (readonly)
Returns the value of attribute current_height.
9 10 11 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 9 def current_height @current_height end |
#current_width ⇒ Object (readonly)
Returns the value of attribute current_width.
9 10 11 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 9 def current_width @current_width end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 9 def @options end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
9 10 11 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 9 def output_path @output_path end |
#polei ⇒ Object (readonly)
Returns the value of attribute polei.
9 10 11 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 9 def polei @polei end |
Instance Method Details
#generate ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/poleica/converters/graphics_magick/thumbnail_options_generator.rb', line 18 def generate [ 'convert', "#{polei.path}[0]", , , ].flatten end |