Class: Poleica::Converters::GraphicsMagick::ConvertOptionsGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/poleica/converters/graphics_magick/convert_options_generator.rb

Overview

Generate options for the GraphicsMagick to_png

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(polei, options = {}) ⇒ ConvertOptionsGenerator

Returns a new instance of ConvertOptionsGenerator.



10
11
12
13
# File 'lib/poleica/converters/graphics_magick/convert_options_generator.rb', line 10

def initialize(polei, options = {})
  @polei     = polei
  @options   = default_options.merge(options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/poleica/converters/graphics_magick/convert_options_generator.rb', line 8

def options
  @options
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



8
9
10
# File 'lib/poleica/converters/graphics_magick/convert_options_generator.rb', line 8

def output_path
  @output_path
end

#poleiObject (readonly)

Returns the value of attribute polei.



8
9
10
# File 'lib/poleica/converters/graphics_magick/convert_options_generator.rb', line 8

def polei
  @polei
end

Instance Method Details

#generateObject



15
16
17
18
19
20
21
22
23
# File 'lib/poleica/converters/graphics_magick/convert_options_generator.rb', line 15

def generate
  [
    'convert',
    "#{polei.path}#{page_options}",
    orient_options,
    resize_options,
    output_options
  ].flatten
end