Sha256: 859e0de7199ad7ef614dabbb6288d673f859b2e480d3dd4f986fee17771984bc
Contents?: true
Size: 1014 Bytes
Versions: 6
Compression:
Stored size: 1014 Bytes
Contents
module GeoWorks # Attributes and methods for vector metadata files module ExternalMetadataFileBehavior extend ActiveSupport::Concern include ::GeoWorks::Extractors::Iso19139Helper include ::GeoWorks::Extractors::FgdcHelper include ::GeoWorks::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(geo_mime_type) || '').parameterize(separator: '_') end end end
Version data entries
6 entries across 6 versions & 1 rubygems