Class: ActiveFedora::Core::FedoraUriTranslator

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/core/fedora_uri_translator.rb

Constant Summary collapse

SLASH =
'/'.freeze

Class Method Summary collapse

Class Method Details

.call(uri) ⇒ Object



4
5
6
7
# File 'lib/active_fedora/core/fedora_uri_translator.rb', line 4

def self.call(uri)
  id = uri.to_s.sub(ActiveFedora.fedora.host + ActiveFedora.fedora.base_path, '')
  id.start_with?(SLASH) ? id[1..-1] : id
end