Class: Languages::Epl2::Barcode2D
- Inherits:
-
Object
- Object
- Languages::Epl2::Barcode2D
- Defined in:
- lib/languages/epl2/barcode.rb
Constant Summary collapse
- BarcodeClasses =
{ data_matrix: ["D",16,16] }
Instance Method Summary collapse
-
#initialize(code_type, opts = {}) ⇒ Barcode2D
constructor
A new instance of Barcode2D.
- #render ⇒ Object
Constructor Details
#initialize(code_type, opts = {}) ⇒ Barcode2D
Returns a new instance of Barcode2D.
37 38 39 40 41 42 43 |
# File 'lib/languages/epl2/barcode.rb', line 37 def initialize(code_type, opts = {}) @font = opts[:font] || Font.new @type,@columns_encode,@rows_encode = BarcodeClasses[code_type] @x = (opts[:at] || [0,0])[0] @y = (opts[:at] || [0,0])[1] @text = opts[:text] || "" end |
Instance Method Details
#render ⇒ Object
45 46 47 |
# File 'lib/languages/epl2/barcode.rb', line 45 def render "b#{@x},#{@y},#{@type},c#{@columns_encode},r#{@rows_encode},\"#{@text}\"" end |