Class: Zebra::PrintJob
- Inherits:
-
Object
- Object
- Zebra::PrintJob
- Defined in:
- lib/zebra/print_job.rb
Defined Under Namespace
Classes: UnknownPrinter
Instance Attribute Summary collapse
-
#printer ⇒ Object
readonly
Returns the value of attribute printer.
Instance Method Summary collapse
-
#initialize(printer) ⇒ PrintJob
constructor
A new instance of PrintJob.
- #print(label) ⇒ Object
Constructor Details
#initialize(printer) ⇒ PrintJob
Returns a new instance of PrintJob.
11 12 13 14 15 |
# File 'lib/zebra/print_job.rb', line 11 def initialize(printer) check_existent_printers printer @printer = printer end |
Instance Attribute Details
#printer ⇒ Object (readonly)
Returns the value of attribute printer.
9 10 11 |
# File 'lib/zebra/print_job.rb', line 9 def printer @printer end |
Instance Method Details
#print(label) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/zebra/print_job.rb', line 17 def print(label) tempfile = label.persist begin send_to_printer tempfile.path ensure tempfile.close end end |