Method: LabelDefinitions::Label#initialize
- Defined in:
- lib/label_definitions/label.rb
#initialize(attributes = {}) ⇒ Label
Returns a new instance of Label.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/label_definitions/label.rb', line 5 def initialize(attributes = {}) @name = attributes.fetch(:name) @rows = attributes.fetch(:rows).to_i @columns = attributes.fetch(:columns).to_i @width = attributes.fetch(:width).to_f @height = attributes.fetch(:height).to_f @row_gutter = attributes.fetch(:row_gutter).to_f @column_gutter = attributes.fetch(:column_gutter).to_f @page_width = attributes.fetch(:page_width).to_f @page_height = attributes.fetch(:page_height).to_f end |