Class: Poleica::Converters::GraphicsMagick::OptionsGenerator

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

Overview

Generate options for the gm command

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OptionsGenerator.



36
37
38
39
# File 'lib/poleica/converters/graphics_magick.rb', line 36

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



34
35
36
# File 'lib/poleica/converters/graphics_magick.rb', line 34

def options
  @options
end

#poleiObject (readonly)

Returns the value of attribute polei.



34
35
36
# File 'lib/poleica/converters/graphics_magick.rb', line 34

def polei
  @polei
end

Instance Method Details

#[](key) ⇒ Object



51
52
53
# File 'lib/poleica/converters/graphics_magick.rb', line 51

def [](key)
  options[key]
end

#generateObject



41
42
43
44
45
46
47
48
49
# File 'lib/poleica/converters/graphics_magick.rb', line 41

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