lib/zebra/epl/label.rb in zebra-epl-0.0.1 vs lib/zebra/epl/label.rb in zebra-epl-0.0.2
- old
+ new
@@ -1,6 +1,7 @@
# encoding: utf-8
+
module Zebra
module Epl
class Label
class InvalidPrintSpeedError < StandardError; end
class InvalidPrintDensityError < StandardError; end
@@ -50,13 +51,20 @@
io << "\n"
# Start new label
io << "N\n"
elements.each do |element|
- io << element.to_s << "\n"
+ io << element.to_epl << "\n"
end
io << "P0\n"
+ end
+
+ def persist
+ tempfile = Tempfile.new "zebra_label"
+ dump_contents tempfile
+ tempfile.rewind
+ tempfile
end
private
def check_required_configurations