Class: MetadataPresenter::ColumnNumber
- Inherits:
-
Object
- Object
- MetadataPresenter::ColumnNumber
- Defined in:
- app/models/metadata_presenter/column_number.rb
Instance Method Summary collapse
-
#initialize(uuid:, coordinates:, new_column:, service:) ⇒ ColumnNumber
constructor
A new instance of ColumnNumber.
- #number ⇒ Object
Constructor Details
#initialize(uuid:, coordinates:, new_column:, service:) ⇒ ColumnNumber
Returns a new instance of ColumnNumber.
3 4 5 6 7 8 |
# File 'app/models/metadata_presenter/column_number.rb', line 3 def initialize(uuid:, coordinates:, new_column:, service:) @uuid = uuid @coordinates = coordinates @new_column = new_column @service = service end |
Instance Method Details
#number ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/models/metadata_presenter/column_number.rb', line 10 def number if service.flow_object(uuid).branch? # Even though we are associating the column number to a specific flow object # in the Coordinates model we do not use column_number + 1 as we are # updating the position for the Spacers that exist for a branch which # are always in the same column as the branch object itself. coordinates.set_branch_spacers_column(uuid, column_number) end column_number end |