Class: Zebra::Zpl::Box

Inherits:
Object
  • Object
show all
Includes:
Printable
Defined in:
lib/zebra/zpl/box.rb

Defined Under Namespace

Classes: InvalidColorError, InvalidLineThickness, InvalidRoundingDegree

Instance Attribute Summary collapse

Attributes included from Printable

#data, #margin, #position, #x, #y

Instance Method Summary collapse

Methods included from Printable

#initialize, #justification, #justification=, #rotation, #rotation=

Instance Attribute Details

#box_heightObject

Returns the value of attribute box_height.



12
13
14
# File 'lib/zebra/zpl/box.rb', line 12

def box_height
  @box_height
end

#box_widthObject

Returns the value of attribute box_width.



12
13
14
# File 'lib/zebra/zpl/box.rb', line 12

def box_width
  @box_width
end

#colorObject

Returns the value of attribute color.



12
13
14
# File 'lib/zebra/zpl/box.rb', line 12

def color
  @color
end

#line_thicknessObject

Returns the value of attribute line_thickness.



12
13
14
# File 'lib/zebra/zpl/box.rb', line 12

def line_thickness
  @line_thickness
end

#rounding_degreeObject

Returns the value of attribute rounding_degree.



12
13
14
# File 'lib/zebra/zpl/box.rb', line 12

def rounding_degree
  @rounding_degree
end

#widthObject

Returns the value of attribute width.



12
13
14
# File 'lib/zebra/zpl/box.rb', line 12

def width
  @width
end

Instance Method Details

#to_zplObject



42
43
44
45
46
# File 'lib/zebra/zpl/box.rb', line 42

def to_zpl
  check_attributes
  puts "The Box class is deprecated. Please switch to the Graphic class (graphic_type = box)." unless ENV['RUBY_ENV'] == 'test'
  "^FO#{x},#{y}^GB#{box_width},#{box_height},#{line_thickness},#{color},#{rounding_degree}^FS"
end