Sha256: 5377006d22fdd09d54cfe96e5aededf30ac1e73d68ebba984685fcd1fccec289

Contents?: true

Size: 744 Bytes

Versions: 33

Compression:

Stored size: 744 Bytes

Contents

module RelatonBib
  class Medium
    # @return [String, NilClass]
    attr_reader :form, :size, :scale

    # @param form [String, NilClass]
    # @param size [String, NilClass]
    # @param scale [String, NilClass]
    def initialize(form: nil, size: nil, scale: nil)
      @form  = form
      @size  = size
      @scale = scale
    end

    # @param builder [Nokogiri::XML::Builder]
    def to_xml(builder)
      builder.medium do
        builder.form form if form
        builder.size size if size
        builder.scale scale if scale
      end
    end

    # @return [Hash]
    def to_hash
      hash = {}
      hash["form"] = form if form
      hash["size"] = size if size
      hash["scale"] = scale if scale
      hash
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/relaton-bib-1.2.4/lib/relaton_bib/medium.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/relaton-bib-1.2.4/lib/relaton_bib/medium.rb
relaton-bib-1.2.4 lib/relaton_bib/medium.rb
relaton-bib-1.2.2 lib/relaton_bib/medium.rb
relaton-bib-1.2.1 lib/relaton_bib/medium.rb
relaton-bib-1.2.0 lib/relaton_bib/medium.rb
relaton-bib-1.1.1 lib/relaton_bib/medium.rb
relaton-bib-1.1.0 lib/relaton_bib/medium.rb
relaton-bib-1.0.4 lib/relaton_bib/medium.rb
relaton-bib-1.0.3 lib/relaton_bib/medium.rb
relaton-bib-1.0.2 lib/relaton_bib/medium.rb
relaton-bib-1.0.1 lib/relaton_bib/medium.rb
relaton-bib-1.0.0 lib/relaton_bib/medium.rb
relaton-bib-0.9.2 lib/relaton_bib/medium.rb
relaton-bib-0.9.1 lib/relaton_bib/medium.rb
relaton-bib-0.9.0 lib/relaton_bib/medium.rb
relaton-bib-0.8.1 lib/relaton_bib/medium.rb
relaton-bib-0.8.0 lib/relaton_bib/medium.rb
relaton-bib-0.7.0 lib/relaton_bib/medium.rb
relaton-bib-0.6.0 lib/relaton_bib/medium.rb