Class: LabelLayout

Inherits:
Object
  • Object
show all
Defined in:
lib/printing_labels.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ LabelLayout

Returns a new instance of LabelLayout.

Raises:

  • (ArgumentError)


129
130
131
132
133
134
135
136
# File 'lib/printing_labels.rb', line 129

def initialize(*args)
  options = args.shift.dup if args.first.is_a?(Hash)
  options ||= {} 
   %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, options.delete(arg.to_sym)) unless options[arg.to_sym].nil?
    end
  raise ArgumentError, "Some options provided are not supported: #{options.keys.join(' ')}." if options.size > 0
end

Instance Attribute Details

#borderObject

Returns the value of attribute border.



127
128
129
# File 'lib/printing_labels.rb', line 127

def border
  @border
end

#l_heightObject

Returns the value of attribute l_height.



127
128
129
# File 'lib/printing_labels.rb', line 127

def l_height
  @l_height
end

#l_widthObject

Returns the value of attribute l_width.



127
128
129
# File 'lib/printing_labels.rb', line 127

def l_width
  @l_width
end

#label_paddingObject

Returns the value of attribute label_padding.



127
128
129
# File 'lib/printing_labels.rb', line 127

def label_padding
  @label_padding
end

#line_heightObject

Returns the value of attribute line_height.



127
128
129
# File 'lib/printing_labels.rb', line 127

def line_height
  @line_height
end

#lm_bottomObject

Returns the value of attribute lm_bottom.



127
128
129
# File 'lib/printing_labels.rb', line 127

def lm_bottom
  @lm_bottom
end

#lm_interObject

Returns the value of attribute lm_inter.



127
128
129
# File 'lib/printing_labels.rb', line 127

def lm_inter
  @lm_inter
end

#lm_leftObject

Returns the value of attribute lm_left.



127
128
129
# File 'lib/printing_labels.rb', line 127

def lm_left
  @lm_left
end

#lm_rightObject

Returns the value of attribute lm_right.



127
128
129
# File 'lib/printing_labels.rb', line 127

def lm_right
  @lm_right
end

#lm_topObject

Returns the value of attribute lm_top.



127
128
129
# File 'lib/printing_labels.rb', line 127

def lm_top
  @lm_top
end

#n_colObject

Returns the value of attribute n_col.



127
128
129
# File 'lib/printing_labels.rb', line 127

def n_col
  @n_col
end

#n_rowObject

Returns the value of attribute n_row.



127
128
129
# File 'lib/printing_labels.rb', line 127

def n_row
  @n_row
end

#pm_bottomObject

Returns the value of attribute pm_bottom.



127
128
129
# File 'lib/printing_labels.rb', line 127

def pm_bottom
  @pm_bottom
end

#pm_leftObject

Returns the value of attribute pm_left.



127
128
129
# File 'lib/printing_labels.rb', line 127

def pm_left
  @pm_left
end

#pm_rightObject

Returns the value of attribute pm_right.



127
128
129
# File 'lib/printing_labels.rb', line 127

def pm_right
  @pm_right
end

#pm_topObject

Returns the value of attribute pm_top.



127
128
129
# File 'lib/printing_labels.rb', line 127

def pm_top
  @pm_top
end

#text_sizeObject

Returns the value of attribute text_size.



127
128
129
# File 'lib/printing_labels.rb', line 127

def text_size
  @text_size
end

#typeObject

Returns the value of attribute type.



127
128
129
# File 'lib/printing_labels.rb', line 127

def type
  @type
end