Class: Spoolprint::ReceiptPrintEasy

Inherits:
Escpos::Printer
  • Object
show all
Defined in:
lib/spoolprint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job = nil) ⇒ ReceiptPrintEasy

Returns a new instance of ReceiptPrintEasy.



9
10
11
12
13
# File 'lib/spoolprint.rb', line 9

def initialize(job = nil)
  super()
  @interface = create_interface(job)
  @server = ServerReceipt.new(self)
end

Instance Attribute Details

#interfaceObject (readonly)

Returns the value of attribute interface.



7
8
9
# File 'lib/spoolprint.rb', line 7

def interface
  @interface
end

Instance Method Details

#start_serverObject



15
16
17
# File 'lib/spoolprint.rb', line 15

def start_server
  @server.start
end

#stop_serverObject



19
20
21
# File 'lib/spoolprint.rb', line 19

def stop_server
  @server.stop
end

#to_escposObject



23
24
25
26
# File 'lib/spoolprint.rb', line 23

def to_escpos
  @interface.taruh_raw(super)
  return @interface.cetak
end