Class: MagickMinimalistic::Configurator
- Inherits:
-
Object
- Object
- MagickMinimalistic::Configurator
- Defined in:
- lib/magick_minimalistic.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#destiny ⇒ Object
Returns the value of attribute destiny.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(params = {}) ⇒ Configurator
constructor
A new instance of Configurator.
- #run ⇒ Object
Methods included from Sanitize
attributes, filename, geometry, type
Methods included from Option
Constructor Details
#initialize(params = {}) ⇒ Configurator
Returns a new instance of Configurator.
13 14 15 16 17 |
# File 'lib/magick_minimalistic.rb', line 13 def initialize(params = {}) @source = params[:source] @config = params[:config] ? params[:config] : {} @destiny = params[:destiny] end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
11 12 13 |
# File 'lib/magick_minimalistic.rb', line 11 def config @config end |
#destiny ⇒ Object
Returns the value of attribute destiny.
11 12 13 |
# File 'lib/magick_minimalistic.rb', line 11 def destiny @destiny end |
#source ⇒ Object
Returns the value of attribute source.
11 12 13 |
# File 'lib/magick_minimalistic.rb', line 11 def source @source end |
Instance Method Details
#command ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/magick_minimalistic.rb', line 23 def command cmd = 'magick ' puts 'Checking source file...' @source = Sanitize::filename(source, true) cmd += "#{source} " puts 'Checking attributes...' attrs = Sanitize::attributes(config) @config = attrs[0] cmd += "#{attrs[1]} " puts 'Checking destiny file...' @destiny = Sanitize::filename(destiny, false) cmd += "#{destiny}" cmd end |
#run ⇒ Object
19 20 21 |
# File 'lib/magick_minimalistic.rb', line 19 def run super(command) end |