Sha256: 80d31d995406a5c4512378bfc2e4b4ad1022807866a1cbef43c54f31e7dbd6c8

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

require_relative "base_mapper"

require_relative "extent"
require_relative "form"
require_relative "physical_description_note"

module LocMods
  class PhysicalDescription < BaseMapper
    attribute :lang, Shale::Type::String
    attribute :script, Shale::Type::String
    attribute :transliteration, Shale::Type::String
    attribute :display_label, Shale::Type::String
    attribute :alt_rep_group, Shale::Type::String
    attribute :form, Form, collection: true
    attribute :reformatting_quality, Shale::Type::String, collection: true
    attribute :internet_media_type, Shale::Type::String, collection: true
    attribute :extent, Extent, collection: true
    attribute :digital_origin, Shale::Type::String, collection: true
    attribute :note, PhysicalDescriptionNote, collection: true

    xml do
      root "physicalDescription"
      namespace "http://www.loc.gov/mods/v3", nil

      map_attribute "lang", to: :lang
      map_attribute "script", to: :script
      map_attribute "transliteration", to: :transliteration
      map_attribute "displayLabel", to: :display_label
      map_attribute "altRepGroup", to: :alt_rep_group
      map_element "form", to: :form
      map_element "reformattingQuality", to: :reformatting_quality
      map_element "internetMediaType", to: :internet_media_type
      map_element "extent", to: :extent
      map_element "digitalOrigin", to: :digital_origin
      map_element "note", to: :note
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loc_mods-0.2.4 lib/loc_mods/physical_description.rb
loc_mods-0.2.3 lib/loc_mods/physical_description.rb
loc_mods-0.2.2 lib/loc_mods/physical_description.rb