Class: BasicBlock::IndexXref

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton_iec/basic_block/index_xref.rb

Instance Method Summary collapse

Constructor Details

#initialize(also:, primary:, target:, **args) ⇒ IndexXref

Returns a new instance of IndexXref.

Parameters:

Options Hash (**args):



11
12
13
14
15
16
17
# File 'lib/relaton_iec/basic_block/index_xref.rb', line 11

def initialize(also:, primary:, target:, **args)
  @also = also
  @primary = primary
  @target = target
  @secondary = args[:secondary]
  @tertiary = args[:tertiary]
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


22
23
24
25
26
27
28
29
# File 'lib/relaton_iec/basic_block/index_xref.rb', line 22

def to_xml(builder) # rubocop:disable Metrics/CyclomaticComplexity
  builder.send "index-xref", also: @also do |b|
    @primary.each { |p| p.to_xml b }
    @secondary&.each { |s| s.to_xml b }
    @tertiary&.each { |t| t.to_xml b }
    @target.each { |t| t.to_xml b }
  end
end