Module: Zebra::Zpl::Printable

Included in:
Barcode, Box, Qrcode, Text
Defined in:
lib/zebra/zpl/printable.rb

Defined Under Namespace

Classes: MissingAttributeError

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data.



11
12
13
# File 'lib/zebra/zpl/printable.rb', line 11

def data
  @data
end

#marginObject

Returns the value of attribute margin.



10
11
12
# File 'lib/zebra/zpl/printable.rb', line 10

def margin
  @margin
end

#positionObject

Returns the value of attribute position.



10
11
12
# File 'lib/zebra/zpl/printable.rb', line 10

def position
  @position
end

#xObject (readonly)

Returns the value of attribute x.



10
11
12
# File 'lib/zebra/zpl/printable.rb', line 10

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



10
11
12
# File 'lib/zebra/zpl/printable.rb', line 10

def y
  @y
end

Instance Method Details

#initialize(options = {}) ⇒ Object



13
14
15
# File 'lib/zebra/zpl/printable.rb', line 13

def initialize(options = {})
  options.each_pair { |attribute, value| self.__send__ "#{attribute}=", value }
end

#justificationObject



28
29
30
# File 'lib/zebra/zpl/printable.rb', line 28

def justification
  @justification || Justification::LEFT
end

#justification=(just) ⇒ Object



23
24
25
26
# File 'lib/zebra/zpl/printable.rb', line 23

def justification=(just)
  Justification.validate_justification just
  @justification = just
end

#rotationObject



41
42
43
# File 'lib/zebra/zpl/printable.rb', line 41

def rotation
  @rotation || Rotation::NO_ROTATION
end

#rotation=(rot) ⇒ Object



36
37
38
39
# File 'lib/zebra/zpl/printable.rb', line 36

def rotation=(rot)
  Rotation.validate_rotation rot
  @rotation = rot
end