Class: Zebra::PrintJob
- Inherits:
-
Object
- Object
- Zebra::PrintJob
- Defined in:
- lib/zebra/print_job.rb
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, ip, print_service: "") ⇒ Object
Constructor Details
#initialize(printer) ⇒ PrintJob
Returns a new instance of PrintJob.
6 7 8 |
# File 'lib/zebra/print_job.rb', line 6 def initialize(printer) @printer = printer end |
Instance Attribute Details
#printer ⇒ Object (readonly)
Returns the value of attribute printer.
4 5 6 |
# File 'lib/zebra/print_job.rb', line 4 def printer @printer end |
Instance Method Details
#print(label, ip, print_service: "") ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/zebra/print_job.rb', line 10 def print(label, ip, print_service: "") @remote_ip = ip if label.is_a? String tempfile = Tempfile.new "zebra_label" tempfile.write label tempfile.close else tempfile = label.persist end send_to_printer(tempfile.path, print_service) end |