module UriService

Constants

TERM
TERMS
VALID_URI_REGEX
VERSION
VOCABULARIES
VOCABULARY

Constants

Public Class Methods

client() click to toggle source
# File lib/uri_service.rb, line 27
def self.client
  return @client
end
init(opts) click to toggle source

Initialize the main instance of UriService::Client opts format: { 'local_uri_base' => 'id.example.com/term/', temporary_uri_base: 'temporary:', 'solr' => {…solr config…}, 'database' => {…database config…} }

# File lib/uri_service.rb, line 19
def self.init(opts)
  if @client && @client.connected?
    @client.disconnect!
  end
  
  @client = UriService::Client.new(opts)
end
required_tables() click to toggle source
# File lib/uri_service.rb, line 35
def self.required_tables
  return [UriService::VOCABULARIES, UriService::TERMS]
end
solr_escape(str) click to toggle source

Wrapper around escape method for different versions of RSolr

# File lib/uri_service.rb, line 40
def self.solr_escape(str)
  if RSolr.respond_to?(:solr_escape)
    return RSolr.solr_escape(str) # Newer method
  else
    return RSolr.escape(str) # Fall back to older method
  end
end
version() click to toggle source
# File lib/uri_service.rb, line 31
def self.version
  return UriService::VERSION
end