Class: RubyLens::ArtModelBuilder::Namespaces

Inherits:
Data
  • Object
show all
Defined in:
lib/rubylens/art_model_builder.rb

Overview

order lists snapshot ordinals in draw order and is the single authority for each shuffle; the snapshot-ordinal-to-draw-position inverse is derived where it is needed rather than stored beside it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#namesObject (readonly)

Returns the value of attribute names

Returns:

  • (Object)

    the current value of names



17
18
19
# File 'lib/rubylens/art_model_builder.rb', line 17

def names
  @names
end

#orderObject (readonly)

Returns the value of attribute order

Returns:

  • (Object)

    the current value of order



17
18
19
# File 'lib/rubylens/art_model_builder.rb', line 17

def order
  @order
end

#reference_rowsObject (readonly)

Returns the value of attribute reference_rows

Returns:

  • (Object)

    the current value of reference_rows



17
18
19
# File 'lib/rubylens/art_model_builder.rb', line 17

def reference_rows
  @reference_rows
end

#rowsObject (readonly)

Returns the value of attribute rows

Returns:

  • (Object)

    the current value of rows



17
18
19
# File 'lib/rubylens/art_model_builder.rb', line 17

def rows
  @rows
end

Instance Method Details

#draw_positionsObject

: () -> Array



32
33
34
35
36
# File 'lib/rubylens/art_model_builder.rb', line 32

def draw_positions
  positions = Array.new(order.length)
  order.each_with_index { |old_index, new_index| positions[old_index] = new_index }
  positions
end

#referenced_dependency_ordinalsObject

Link endpoints past the namespace block address dependency stars, which the snapshot numbers from zero after the namespaces.

: () -> Array



27
28
29
# File 'lib/rubylens/art_model_builder.rb', line 27

def referenced_dependency_ordinals
  reference_rows.map { |_referring_index, referenced_index| referenced_index - order.length }
end