Class: Zebra::PrintJob

Inherits:
Object
  • Object
show all
Defined in:
lib/zebra/print_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#printerObject (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



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