Class: Thermal::Starprnt::Buffer
- Inherits:
-
Object
- Object
- Thermal::Starprnt::Buffer
- Defined in:
- lib/thermal/starprnt/buffer.rb
Constant Summary collapse
- COMMANDS =
i[ printRawText printRasterReceipt printImage printBase64Image print ].freeze
Instance Method Summary collapse
- #flush ⇒ Object
-
#print(array) ⇒ Object
print is a special command that takes an an array of subcommands.
- #to_a ⇒ Object
Instance Method Details
#flush ⇒ Object
25 26 27 28 29 |
# File 'lib/thermal/starprnt/buffer.rb', line 25 def flush tmp = commands @commands = [] tmp end |
#print(array) ⇒ Object
print is a special command that takes an an array of subcommands
13 14 15 16 |
# File 'lib/thermal/starprnt/buffer.rb', line 13 def print(array) commands.push(print: []) if last_command != :print commands.last[:print] += Array.wrap(array) end |
#to_a ⇒ Object
31 32 33 |
# File 'lib/thermal/starprnt/buffer.rb', line 31 def to_a commands.deep_dup end |