Module: TagLayout::InRows
- Defined in:
- app/models/tag_layout/in_rows.rb
Overview
Lays out the tags so that they are row ordered.
Class Method Summary collapse
- .direction ⇒ Object
- .tag2_index(row, column, scale, height, width) ⇒ Object
-
.tag_index(row, column, scale, _height, width) ⇒ Object
Returns the tag index for the primary tag That is the one laid out in rows with four copies of each.
- .well_order_scope ⇒ Object
Class Method Details
.direction ⇒ Object
4 5 6 |
# File 'app/models/tag_layout/in_rows.rb', line 4 def self.direction 'row' end |
.tag2_index(row, column, scale, height, width) ⇒ Object
20 21 22 |
# File 'app/models/tag_layout/in_rows.rb', line 20 def self.tag2_index(row, column, scale, height, width) tag_index(row, column, scale, height, width) end |
.tag_index(row, column, scale, _height, width) ⇒ Object
Returns the tag index for the primary tag That is the one laid out in rows with four copies of each
14 15 16 17 18 |
# File 'app/models/tag_layout/in_rows.rb', line 14 def self.tag_index(row, column, scale, _height, width) tag_col = (column / scale) tag_row = (row / scale) tag_col + (width / scale * tag_row) end |
.well_order_scope ⇒ Object
8 9 10 |
# File 'app/models/tag_layout/in_rows.rb', line 8 def self.well_order_scope :in_row_major_order end |