Sha256: ab068b3c1aedabc3e56c248868d2c3abd92e07710feb4c1be917867738ab0f61

Contents?: true

Size: 404 Bytes

Versions: 78

Compression:

Stored size: 404 Bytes

Contents

module ActiveFedora::Core
  class FedoraIdTranslator
    SLASH = '/'.freeze
    def self.call(id)
      id = URI.escape(id, '[]'.freeze)
      id = "/#{id}" unless id.start_with? SLASH
      unless ActiveFedora.fedora.base_path == SLASH || id.start_with?("#{ActiveFedora.fedora.base_path}/")
        id = ActiveFedora.fedora.base_path + id
      end
      ActiveFedora.fedora.host + id
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
active-fedora-12.0.2 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.0.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.5.2 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.0.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.5.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.4.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.4.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.3.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.3.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.2.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.6 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.5 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.4 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.3 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.2 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.1.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-10.3.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-9.7.3 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.0.1 lib/active_fedora/core/fedora_id_translator.rb