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-13.2.4 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.2.3 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.2.3 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.2.2 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.2.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.1.3 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.5.6 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.2.2 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.2.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.2.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.0.3 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.5.5 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.1.2 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.1.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.1.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-13.0.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.1.1 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-12.1.0 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.5.4 lib/active_fedora/core/fedora_id_translator.rb
active-fedora-11.5.3 lib/active_fedora/core/fedora_id_translator.rb