Sha256: 0f6dfd88ed36f4ce379dcd7324cf41d3ea7249a54489f8bfa31881e2adbcfa0f

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

require_relative "base_mapper"

require_relative "cartographic_extension"
require_relative "holding_simple"
require_relative "physical_location"
require_relative "url"

module LocMods
  class Location < 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 :physical_location, PhysicalLocation, collection: true
    attribute :shelf_locator, Shale::Type::String, collection: true
    attribute :url, Url, collection: true
    attribute :holding_simple, HoldingSimple
    attribute :holding_external, CartographicExtension

    xml do
      root "location"
      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 "physicalLocation", to: :physical_location
      map_element "shelfLocator", to: :shelf_locator
      map_element "url", to: :url
      map_element "holdingSimple", to: :holding_simple
      map_element "holdingExternal", to: :holding_external
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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