Sha256: 0260a5887ada2a530a5339b6b07e194ac30926fce1d17fd6e40eb3369006dc88

Contents?: true

Size: 685 Bytes

Versions: 4

Compression:

Stored size: 685 Bytes

Contents

module RelatonIeee
  class Committee
    # @return [String]
    attr_reader :type, :name

    # @return [String, NilClass]
    attr_reader :chair

    # @param type [String]
    # @param name [String]
    # @param chair [String, NilClass]
    def initialize(type:, name:, chair: nil)
      @type = type
      @name = name
      @chair = chair
    end

    # @param builder [Nokogiri::XML::Builder]
    def to_xml(builder)
      builder.committee type: type do |b|
        b.name name
        b.chair chair if chair
      end
    end

    # @return [Hash]
    def to_hash
      hash = { "type" => type, "name" => name }
      hash["chair"] = chair if chair
      hash
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/relaton-ieee-1.2.0/lib/relaton_ieee/committee.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/relaton-ieee-1.2.0/lib/relaton_ieee/committee.rb
relaton-ieee-1.2.0 lib/relaton_ieee/committee.rb
relaton-ieee-1.1.0 lib/relaton_ieee/committee.rb