Class: MetadataPresenter::RowNumber

Inherits:
Object
  • Object
show all
Defined in:
app/models/metadata_presenter/row_number.rb

Constant Summary collapse

ROW_ZERO =
0

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, route:, current_row:, coordinates:, service:) ⇒ RowNumber

Returns a new instance of RowNumber.



3
4
5
6
7
8
9
# File 'app/models/metadata_presenter/row_number.rb', line 3

def initialize(uuid:, route:, current_row:, coordinates:, service:)
  @uuid = uuid
  @route = route
  @current_row = current_row
  @coordinates = coordinates
  @service = service
end

Instance Method Details

#numberObject



13
14
15
16
17
18
19
# File 'app/models/metadata_presenter/row_number.rb', line 13

def number
  if service.flow_object(uuid).branch?
    coordinates.set_branch_spacers_row(uuid, calculated_row)
  end

  calculated_row
end