Class: BasicBlock::Formula
- Inherits:
-
Object
- Object
- BasicBlock::Formula
- Defined in:
- lib/relaton_iec/basic_block/formula.rb
Instance Method Summary collapse
-
#initialize(id:, content:, note:, **args) ⇒ Formula
constructor
A new instance of Formula.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(id:, content:, note:, **args) ⇒ Formula
Returns a new instance of Formula.
13 14 15 16 17 18 |
# File 'lib/relaton_iec/basic_block/formula.rb', line 13 def initialize(id:, content:, note:, **args) @id = id @content = content @note = note @unnumbered = args[:unnumbered] end |
Instance Method Details
#to_xml(builder) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/relaton_iec/basic_block/formula.rb', line 23 def to_xml(builder) # rubocop:disable Metrics/CyclomaticComplexity f = builder.formula id: @id do |b| @content.to_xml b @dl&.each { |d| d.to_xml b } @note.each { |n| n.to_xml b } end f[:unnumbered] = @unnumbered if @unnumbered f[:subsequence] = @subsequence if @subsequence f[:inequality] = @inequality if @ineainequality end |