module ActiveFedora

def class_from_string(*args)

Other tags:
    Example: Search within ActiveFedora::RdfNode for a class called "TermProxy" -
def class_from_string(*args)
  ActiveFedora::ModelClassifier.class_from_string(*args)
end

def config

def config
  fedora_config
end

def enable_solr_updates?

def enable_solr_updates?
  if defined?(ENABLE_SOLR_UPDATES)
    ENABLE_SOLR_UPDATES
  else
    true
  end
end

def environment

Returns:
  • (String) -
def environment
  if config_options.fetch(:environment, nil)
    return config_options[:environment]
  elsif defined?(Rails.env) && !Rails.env.nil?
    return Rails.env.to_s
  elsif defined?(ENV['environment']) && !ENV['environment'].nil?
    return ENV['environment']
  elsif defined?(ENV['RAILS_ENV']) && !ENV['RAILS_ENV'].nil?
    raise "You're depending on RAILS_ENV for setting your environment. Please use ENV['environment'] for non-rails environment setting: 'rake foo:bar environment=test'"
  else
    ENV['environment'] = 'development'
  end
end

def fedora

def fedora
  @fedora ||= Fedora.new(fedora_config.credentials)
end

def fedora_config

def fedora_config
  @fedora_config ||= Config.new(configurator.fedora_config)
end

def id_field

def id_field
  if defined?(SOLR_DOCUMENT_ID) && !SOLR_DOCUMENT_ID.nil?
    SOLR_DOCUMENT_ID
  elsif defined?(Solrizer)
    Solrizer.default_field_mapper.id_field
  else
    'id'.freeze
  end
end

def index_field_mapper

def index_field_mapper
  Solrizer.default_field_mapper
end

def init(options = {})

def init(options = {})
  # Make config_options into a Hash if nil is passed in as the value
  options = {} if options.nil?
  # For backwards compatibility, handle cases where config_path (a String) is passed in as the argument rather than a config_options hash
  # In all other cases, set config_path to config_options[:config_path], which is ok if it's nil
  if options.is_a? String
    raise ArgumentError, "Calling ActiveFedora.init with a path as an argument has been removed.  Use ActiveFedora.init(:fedora_config_path=>#{options})"
  end
  @fedora_config = nil
  SolrService.reset!
  Predicates.predicate_config = nil
  configurator.init(options)
end

def model_mapper

def model_mapper
  ActiveFedora::DefaultModelMapper.new
end

def root

def root
  ::File.expand_path('../..', __FILE__)
end

def solr

def solr
  ActiveFedora::SolrService.instance
end

def version

def version
  ActiveFedora::VERSION
end