Module: Sound::DwcMediaExtensions

Extended by:
ActiveSupport::Concern
Includes:
Shared::Dwc::MediaExtensions
Included in:
Sound
Defined in:
app/models/sound/dwc_media_extensions.rb

Constant Summary collapse

DWC_MEDIA_SOUND_EXTENSION_MAP =

Only implementations specific to Sound. See Shared::Dwc::MediaExtensions#DWC_MEDIA_SHARED_EXTENSION_MAP as well.

{
  'dc:type': :dwc_media_dc_type,
  #'dcmi:type': :dwc_media_dcmi_type,
  'dc:format': :dwc_media_dc_format,
  # 'dcterms:format',
  accessURI: :dwc_media_access_uri,
}.freeze

Instance Method Summary collapse

Instance Method Details

#darwin_core_media_extension_sound_rowObject



16
17
18
19
20
21
22
23
# File 'app/models/sound/dwc_media_extensions.rb', line 16

def darwin_core_media_extension_sound_row
  h = {}
  (DWC_MEDIA_SOUND_EXTENSION_MAP.merge(Shared::Dwc::MediaExtensions::DWC_MEDIA_SHARED_EXTENSION_MAP)).each do |k, v|
    h[k] = send(v)
  end

  h
end

#dwc_media_access_uriObject



37
38
39
# File 'app/models/sound/dwc_media_extensions.rb', line 37

def dwc_media_access_uri
  Shared::Api.sound_link(self)
end

#dwc_media_dc_formatObject



33
34
35
# File 'app/models/sound/dwc_media_extensions.rb', line 33

def dwc_media_dc_format
  "#{sound_file.content_type}"
end

#dwc_media_dc_typeObject



25
26
27
# File 'app/models/sound/dwc_media_extensions.rb', line 25

def dwc_media_dc_type
  'Sound'
end

#dwc_media_dcmi_typeObject



29
30
31
# File 'app/models/sound/dwc_media_extensions.rb', line 29

def dwc_media_dcmi_type
  'http://purl.org/dc/dcmitype/Sound'
end