Class: Quadtone::Tools::PrinterOptions
- Inherits:
-
Quadtone::Tool
- Object
- Quadtone::Tool
- Quadtone::Tools::PrinterOptions
- Defined in:
- lib/quadtone/tools/printer_options.rb
Instance Attribute Summary collapse
-
#printer ⇒ Object
Returns the value of attribute printer.
-
#show_attributes ⇒ Object
Returns the value of attribute show_attributes.
Attributes inherited from Quadtone::Tool
Instance Method Summary collapse
Methods inherited from Quadtone::Tool
#parse_global_option, process_args, #process_environment
Instance Attribute Details
#printer ⇒ Object
Returns the value of attribute printer.
7 8 9 |
# File 'lib/quadtone/tools/printer_options.rb', line 7 def printer @printer end |
#show_attributes ⇒ Object
Returns the value of attribute show_attributes.
8 9 10 |
# File 'lib/quadtone/tools/printer_options.rb', line 8 def show_attributes @show_attributes end |
Instance Method Details
#load_profile ⇒ Object
10 11 12 |
# File 'lib/quadtone/tools/printer_options.rb', line 10 def load_profile false end |
#parse_option(option, args) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/quadtone/tools/printer_options.rb', line 14 def parse_option(option, args) case option when '--printer' @printer = Printer.new(args.shift) when '--show-attributes' @show_attributes = true end end |
#run(*args) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/quadtone/tools/printer_options.rb', line 23 def run(*args) if @printer printer = @printer elsif @profile printer = @profile.printer else raise ToolUsageError, "Must specify either printer or profile" end printer.show_attributes if @show_attributes printer. printer.show_inks end |