Sha256: 607d761c2bf2adb89d347c64a55fd2770cf05ee116b01ea5078fd3c417b1fd52
Contents?: true
Size: 1015 Bytes
Versions: 15
Compression:
Stored size: 1015 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(geo_mime_type) || '').parameterize('_') end end end
Version data entries
15 entries across 15 versions & 1 rubygems