Class: Zebra::Epl::Barcode

Inherits:
Object
  • Object
show all
Includes:
Printable
Defined in:
lib/zebra/epl/barcode.rb

Defined Under Namespace

Classes: InvalidNarrowBarWidthError, InvalidWideBarWidthError

Instance Attribute Summary collapse

Attributes included from Printable

#data, #position, #x, #y

Instance Method Summary collapse

Methods included from Printable

#initialize, #rotation, #rotation=

Instance Attribute Details

#heightObject

Returns the value of attribute height.



11
12
13
# File 'lib/zebra/epl/barcode.rb', line 11

def height
  @height
end

#narrow_bar_widthObject

Returns the value of attribute narrow_bar_width.



12
13
14
# File 'lib/zebra/epl/barcode.rb', line 12

def narrow_bar_width
  @narrow_bar_width
end


30
31
32
# File 'lib/zebra/epl/barcode.rb', line 30

def print_human_readable_code
  @print_human_readable_code || false
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/zebra/epl/barcode.rb', line 12

def type
  @type
end

#wide_bar_widthObject

Returns the value of attribute wide_bar_width.



12
13
14
# File 'lib/zebra/epl/barcode.rb', line 12

def wide_bar_width
  @wide_bar_width
end

Instance Method Details

#to_eplObject



34
35
36
37
38
# File 'lib/zebra/epl/barcode.rb', line 34

def to_epl
  check_attributes
  human_readable = print_human_readable_code ? "B" : "N"
  ["B#{x}", y, rotation, type, narrow_bar_width, wide_bar_width, height, human_readable, "\"#{data}\""].join(",")
end