Class: BasicBlock::Index
- Inherits:
-
Object
- Object
- BasicBlock::Index
- Defined in:
- lib/relaton_iec/basic_block/index.rb
Instance Method Summary collapse
-
#initialize(primary:, **args) ⇒ Index
constructor
A new instance of Index.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(primary:, **args) ⇒ Index
Returns a new instance of Index.
10 11 12 13 14 15 |
# File 'lib/relaton_iec/basic_block/index.rb', line 10 def initialize(primary:, **args) @to = args[:to] @primary = primary @secondary = args[:secondary] @tertiary = args[:tertiary] end |
Instance Method Details
#to_xml(builder) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/relaton_iec/basic_block/index.rb', line 18 def to_xml(builder) # rubocop:disable Metrics/CyclomaticComplexity idx = builder.index do |b| @primary.each { |p| p.to_xml b } @secondary&.each { |s| s.to_xml b } @tertiary&.each { |t| t.to_xml b } end idx[:to] = @to if @to end |