Class: Zebra::PrintJob
- Inherits:
-
Object
- Object
- Zebra::PrintJob
- Defined in:
- lib/zebra/print_job.rb
Instance Attribute Summary collapse
-
#printer ⇒ Object
readonly
class UnknownPrinter < StandardError def initialize(printer) super(“Could not find a printer named ##printer”) end end.
Instance Method Summary collapse
-
#initialize(printer) ⇒ PrintJob
constructor
A new instance of PrintJob.
- #print(label, ip) ⇒ 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)
class UnknownPrinter < StandardError
def initialize(printer)
super("Could not find a printer named #{printer}")
end
end
9 10 11 |
# File 'lib/zebra/print_job.rb', line 9 def printer @printer end |
Instance Method Details
#print(label, ip) ⇒ Object
17 18 19 20 21 |
# File 'lib/zebra/print_job.rb', line 17 def print(label, ip) @remote_ip = ip tempfile = label.persist send_to_printer tempfile.path end |