Module: Zebra::Zpl::Printable
Defined Under Namespace
Classes: MissingAttributeError
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#margin ⇒ Object
Returns the value of attribute margin.
-
#position ⇒ Object
Returns the value of attribute position.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #initialize(options = {}) ⇒ Object
- #justification ⇒ Object
- #justification=(just) ⇒ Object
- #rotation ⇒ Object
- #rotation=(rot) ⇒ Object
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/zebra/zpl/printable.rb', line 11 def data @data end |
#margin ⇒ Object
Returns the value of attribute margin.
10 11 12 |
# File 'lib/zebra/zpl/printable.rb', line 10 def margin @margin end |
#position ⇒ Object
Returns the value of attribute position.
10 11 12 |
# File 'lib/zebra/zpl/printable.rb', line 10 def position @position end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
10 11 12 |
# File 'lib/zebra/zpl/printable.rb', line 10 def x @x end |
#y ⇒ Object (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( = {}) .each_pair { |attribute, value| self.__send__ "#{attribute}=", value } end |
#justification ⇒ Object
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 |
#rotation ⇒ Object
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 |