Class: LabelLayout
- Inherits:
-
Object
- Object
- LabelLayout
- Defined in:
- lib/printing_labels.rb
Instance Attribute Summary collapse
-
#border ⇒ Object
Returns the value of attribute border.
-
#l_height ⇒ Object
Returns the value of attribute l_height.
-
#l_width ⇒ Object
Returns the value of attribute l_width.
-
#label_padding ⇒ Object
Returns the value of attribute label_padding.
-
#line_height ⇒ Object
Returns the value of attribute line_height.
-
#lm_bottom ⇒ Object
Returns the value of attribute lm_bottom.
-
#lm_inter ⇒ Object
Returns the value of attribute lm_inter.
-
#lm_left ⇒ Object
Returns the value of attribute lm_left.
-
#lm_right ⇒ Object
Returns the value of attribute lm_right.
-
#lm_top ⇒ Object
Returns the value of attribute lm_top.
-
#n_col ⇒ Object
Returns the value of attribute n_col.
-
#n_row ⇒ Object
Returns the value of attribute n_row.
-
#pm_bottom ⇒ Object
Returns the value of attribute pm_bottom.
-
#pm_left ⇒ Object
Returns the value of attribute pm_left.
-
#pm_right ⇒ Object
Returns the value of attribute pm_right.
-
#pm_top ⇒ Object
Returns the value of attribute pm_top.
-
#text_size ⇒ Object
Returns the value of attribute text_size.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(*args) ⇒ LabelLayout
constructor
A new instance of LabelLayout.
Constructor Details
#initialize(*args) ⇒ LabelLayout
Returns a new instance of LabelLayout.
129 130 131 132 133 134 135 136 |
# File 'lib/printing_labels.rb', line 129 def initialize(*args) = args.shift.dup if args.first.is_a?(Hash) ||= {} %w(type border n_row n_col l_width l_height pm_top pm_left pm_bottom pm_right lm_left lm_right lm_top lm_bottom lm_inter label_padding text_size line_height).each do |arg| self.send("#{arg}=".to_sym, .delete(arg.to_sym)) unless [arg.to_sym].nil? end raise ArgumentError, "Some options provided are not supported: #{options.keys.join(' ')}." if .size > 0 end |
Instance Attribute Details
#border ⇒ Object
Returns the value of attribute border.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def border @border end |
#l_height ⇒ Object
Returns the value of attribute l_height.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def l_height @l_height end |
#l_width ⇒ Object
Returns the value of attribute l_width.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def l_width @l_width end |
#label_padding ⇒ Object
Returns the value of attribute label_padding.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def label_padding @label_padding end |
#line_height ⇒ Object
Returns the value of attribute line_height.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def line_height @line_height end |
#lm_bottom ⇒ Object
Returns the value of attribute lm_bottom.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def lm_bottom @lm_bottom end |
#lm_inter ⇒ Object
Returns the value of attribute lm_inter.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def lm_inter @lm_inter end |
#lm_left ⇒ Object
Returns the value of attribute lm_left.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def lm_left @lm_left end |
#lm_right ⇒ Object
Returns the value of attribute lm_right.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def lm_right @lm_right end |
#lm_top ⇒ Object
Returns the value of attribute lm_top.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def lm_top @lm_top end |
#n_col ⇒ Object
Returns the value of attribute n_col.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def n_col @n_col end |
#n_row ⇒ Object
Returns the value of attribute n_row.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def n_row @n_row end |
#pm_bottom ⇒ Object
Returns the value of attribute pm_bottom.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def pm_bottom @pm_bottom end |
#pm_left ⇒ Object
Returns the value of attribute pm_left.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def pm_left @pm_left end |
#pm_right ⇒ Object
Returns the value of attribute pm_right.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def pm_right @pm_right end |
#pm_top ⇒ Object
Returns the value of attribute pm_top.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def pm_top @pm_top end |
#text_size ⇒ Object
Returns the value of attribute text_size.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def text_size @text_size end |
#type ⇒ Object
Returns the value of attribute type.
127 128 129 |
# File 'lib/printing_labels.rb', line 127 def type @type end |