Class: Stupidedi::Schema::Generation::Models::LoopDefinition
- Inherits:
-
Struct
- Object
- Struct
- Stupidedi::Schema::Generation::Models::LoopDefinition
- Defined in:
- lib/stupidedi/schema/generation/models.rb
Overview
A loop within a table or another loop. #children nests recursively. #max_reps is nil for unbounded.
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#max_reps ⇒ Object
Returns the value of attribute max_reps.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children
64 65 66 |
# File 'lib/stupidedi/schema/generation/models.rb', line 64 def children @children end |
#identifier ⇒ Object
Returns the value of attribute identifier
64 65 66 |
# File 'lib/stupidedi/schema/generation/models.rb', line 64 def identifier @identifier end |
#max_reps ⇒ Object
Returns the value of attribute max_reps
64 65 66 |
# File 'lib/stupidedi/schema/generation/models.rb', line 64 def max_reps @max_reps end |
#position ⇒ Object
Returns the value of attribute position
64 65 66 |
# File 'lib/stupidedi/schema/generation/models.rb', line 64 def position @position end |
Instance Method Details
#ordered_children ⇒ Object
65 66 67 |
# File 'lib/stupidedi/schema/generation/models.rb', line 65 def ordered_children children.each_with_index.sort_by { |child, i| [child.position, i] }.map(&:first) end |
#segment_use? ⇒ Boolean
69 70 71 |
# File 'lib/stupidedi/schema/generation/models.rb', line 69 def segment_use? false end |