Sha256: f79c6a0af1dbd8db4c99ff80ca680cd673861bd4d0b56f30f9c1e7bd6ea21f15

Contents?: true

Size: 959 Bytes

Versions: 26

Compression:

Stored size: 959 Bytes

Contents

module BasicBlock
  class Formula
    #
    # @param [String] id
    # @param [BasicBlock::Stem] content
    # @param [Array<BasicBlock::Note>] note
    # @param [Hash] args
    # @option args [Boolean, nil] :unnumbered
    # @option args [String, nil] :subsequence
    # @option args [Boolean, nil] :inequality
    # @option args [BasicBlock::Dl, nil] :dl
    #
    def initialize(id:, content:, note:, **args)
      @id = id
      @content = content
      @note = note
      @unnumbered = args[:unnumbered]
    end

    #
    # @param [Builder] builder
    #
    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
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
relaton-iec-1.19.1 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.19.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.18.1 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.18.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.17.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.16.4 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.16.3 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.16.2 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.16.1 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.16.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.14.4 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.14.3 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.14.2 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.14.1 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.14.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.13.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.12.0 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.11.4 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.11.3 lib/relaton_iec/basic_block/formula.rb
relaton-iec-1.11.2 lib/relaton_iec/basic_block/formula.rb