Sha256: 0c0a93e34932b7a3af85de9d0e6307f86a6546eb58e11949b36581d6768c6db7
Contents?: true
Size: 1011 Bytes
Versions: 3
Compression:
Stored size: 1011 Bytes
Contents
module GeoConcerns # Attributes and methods for vector metadata files module ExternalMetadataFileBehavior extend ActiveSupport::Concern include ::GeoConcerns::Extractors::Iso19139Helper include ::GeoConcerns::Extractors::FgdcHelper include ::GeoConcerns::Extractors::ModsHelper # Extracts properties from the constitutent external metadata file # @example # extract_iso19139_metadata # extract_fgdc_metadata # extract_mods_metadata # @return [Hash] def extract_metadata raise ArgumentError, "MIME type unspecified or not configured" if schema.blank? fn = "extract_#{schema.downcase}_metadata" raise ArgumentError, "Unsupported metadata standard: #{schema}" unless respond_to?(fn.to_sym) send(fn, metadata_xml) end # Retrives data from PCDM::File def metadata_xml Nokogiri::XML(original_file.content) end def schema (MetadataFormatService.label(mime_type) || '').parameterize('_') end end end
Version data entries
3 entries across 3 versions & 1 rubygems