Class: SolrMakr::SunspotConfiguration
- Inherits:
-
Object
- Object
- SolrMakr::SunspotConfiguration
- Includes:
- ActiveSupport::Configurable, HasSolrAttributes
- Defined in:
- lib/solr_makr/sunspot_configuration.rb
Instance Method Summary collapse
- #build_config ⇒ ActiveSupport::HashWithIndifferentAccess private
- #generate_path ⇒ String
- #to_yaml(options = {}) ⇒ String
Methods included from HasSolrAttributes
Instance Method Details
#build_config ⇒ ActiveSupport::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.
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_path ⇒ 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
28 29 30 31 32 |
# File 'lib/solr_makr/sunspot_configuration.rb', line 28 def to_yaml( = {}) YAML.quick_emit self.object_id, do |out| out.represent_map nil, configuration.to_hash end end |