Class: LabelDefinitions::Label
- Inherits:
-
Object
- Object
- LabelDefinitions::Label
- Defined in:
- lib/label_definitions/label.rb
Defined Under Namespace
Classes: Page
Instance Attribute Summary collapse
-
#column_gutter ⇒ Object
readonly
Returns the value of attribute column_gutter.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#row_gutter ⇒ Object
readonly
Returns the value of attribute row_gutter.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Label
constructor
A new instance of Label.
- #page ⇒ Object
Constructor Details
#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 |
Instance Attribute Details
#column_gutter ⇒ Object (readonly)
Returns the value of attribute column_gutter.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def column_gutter @column_gutter end |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def columns @columns end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def height @height end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def name @name end |
#row_gutter ⇒ Object (readonly)
Returns the value of attribute row_gutter.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def row_gutter @row_gutter end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def rows @rows end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'lib/label_definitions/label.rb', line 3 def width @width end |