class Quadtone::Tools::Print

Attributes

calibrate[RW]
printer_options[RW]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/quadtone/tools/print.rb, line 10
def initialize
  super
  @printer_options = {}
end

Public Instance Methods

parse_option(option, args) click to toggle source
# 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) click to toggle source
# 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