Sha256: 4b935adeba57e51bb35d3d97394571a34af8cac574ca13b296bbb9496253ce42

Contents?: true

Size: 692 Bytes

Versions: 4

Compression:

Stored size: 692 Bytes

Contents

module RelatonBib
  class << self
    def medium_hash_to_bib(ret)
      ret[:medium] and ret[:medium] = Medium.new(ret[:medium])
    end
  end

  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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
relaton-bib-0.3.1 lib/relaton_bib/medium.rb
relaton-bib-0.3.0 lib/relaton_bib/medium.rb
relaton-bib-0.2.5 lib/relaton_bib/medium.rb
relaton-bib-0.2.4 lib/relaton_bib/medium.rb