Sha256: c018c84ae06419195e0d9324cbd097cec9ca702d0b3231afc872ab31d634d89a

Contents?: true

Size: 698 Bytes

Versions: 52

Compression:

Stored size: 698 Bytes

Contents

module Cul
  module Scv
    module Fedora
      module UrlHelperBehavior

        def fedora_url
          @fedora_url ||= ActiveFedora.config.credentials[:url]
        end

        def pid_for_url(pid)
          pid.gsub(/^\//,'').gsub(/info:fedora\//,'')
        end

        def fedora_object_url(pid)
          fedora_url + '/objects/' + pid_for_url(pid)
        end

        def fedora_ds_url(pid, dsid)
          fedora_object_url(pid) + '/datastreams/' + dsid
        end

        def fedora_method_url(pid, method)
          fedora_object_url(pid) + '/methods/' + method
        end

        def fedora_risearch_url
          fedora_url + '/risearch'
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
cul_scv_hydra-0.22.6 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.22.5 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.22.4 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.22.3 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.22.2 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.22.1 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.22.0 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.8 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.7 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.6 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.5 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.4 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.3 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.2 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.21.0 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.20.1 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.20.0 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.19.5 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.19.4 lib/cul_scv_fedora/url_helper_behavior.rb
cul_scv_hydra-0.19.3 lib/cul_scv_fedora/url_helper_behavior.rb