Class: SolrMakr::SunspotConfiguration

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable, HasSolrAttributes
Defined in:
lib/solr_makr/sunspot_configuration.rb

Instance Method Summary collapse

Methods included from HasSolrAttributes

#app_configuration

Instance Method Details

#build_configActiveSupport::HashWithIndifferentAccess

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (ActiveSupport::HashWithIndifferentAccess)


36
37
38
39
40
41
42
# File 'lib/solr_makr/sunspot_configuration.rb', line 36

def build_config
  {}.tap do |hsh|
    hsh[environment] = {}.tap do |inner_hsh|
      inner_hsh[:solr] = attributes.slice(:hostname, :port, :log_level, :path)
    end
  end.with_indifferent_access
end

#generate_pathString

Returns:

  • (String)


45
46
47
# File 'lib/solr_makr/sunspot_configuration.rb', line 45

def generate_path
  File.join('/', path_prefix, collection)
end

#to_yaml(options = {}) ⇒ String

Returns:

  • (String)


28
29
30
31
32
# File 'lib/solr_makr/sunspot_configuration.rb', line 28

def to_yaml(options = {})
  YAML.quick_emit self.object_id, options do |out|
    out.represent_map nil, configuration.to_hash
  end
end