Class: Quadtone::Tools::Print
- Inherits:
-
Quadtone::Tool
- Object
- Quadtone::Tool
- Quadtone::Tools::Print
- Defined in:
- lib/quadtone/tools/print.rb
Instance Attribute Summary collapse
-
#calibrate ⇒ Object
Returns the value of attribute calibrate.
-
#printer_options ⇒ Object
Returns the value of attribute printer_options.
Attributes inherited from Quadtone::Tool
Instance Method Summary collapse
-
#initialize ⇒ Print
constructor
A new instance of Print.
- #parse_option(option, args) ⇒ Object
- #run(*args) ⇒ Object
Methods inherited from Quadtone::Tool
#load_profile, #parse_global_option, process_args, #process_environment
Constructor Details
#initialize ⇒ Print
Returns a new instance of Print.
10 11 12 13 |
# File 'lib/quadtone/tools/print.rb', line 10 def initialize super @printer_options = {} end |
Instance Attribute Details
#calibrate ⇒ Object
Returns the value of attribute calibrate.
7 8 9 |
# File 'lib/quadtone/tools/print.rb', line 7 def calibrate @calibrate end |
#printer_options ⇒ Object
Returns the value of attribute printer_options.
8 9 10 |
# File 'lib/quadtone/tools/print.rb', line 8 def @printer_options end |
Instance Method Details
#parse_option(option, args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/quadtone/tools/print.rb', line 15 def parse_option(option, args) case option when '--calibrate' @calibrate = true when '--option', '--options' @printer_options.merge!( Hash[ args.shift.split(',').map { |o| o.split('=') } ] ) end end |
#run(*args) ⇒ Object
28 29 30 31 32 |
# File 'lib/quadtone/tools/print.rb', line 28 def run(*args) args.map { |p| Path.new(p) }.each do |image_path| @profile.print_file(image_path, calibrate: @calibrate, printer_options: @printer_options) end end |