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
relaton-bib-0.5.2 lib/relaton_bib/medium.rb
relaton-bib-0.5.1 lib/relaton_bib/medium.rb
relaton-bib-0.5.0 lib/relaton_bib/medium.rb
relaton-bib-0.4.1 lib/relaton_bib/medium.rb
relaton-bib-0.4.0 lib/relaton_bib/medium.rb
relaton-bib-0.3.12 lib/relaton_bib/medium.rb
relaton-bib-0.3.11 lib/relaton_bib/medium.rb
relaton-bib-0.3.10 lib/relaton_bib/medium.rb
relaton-bib-0.3.9 lib/relaton_bib/medium.rb
relaton-bib-0.3.8 lib/relaton_bib/medium.rb
relaton-bib-0.3.7 lib/relaton_bib/medium.rb
relaton-bib-0.3.6 lib/relaton_bib/medium.rb
relaton-bib-0.3.5 lib/relaton_bib/medium.rb