Class: SearchSolrTools::Helpers::FacetConfiguration
- Inherits:
-
Object
- Object
- SearchSolrTools::Helpers::FacetConfiguration
- Includes:
- Singleton
- Defined in:
- lib/search_solr_tools/helpers/facet_configuration.rb
Overview
Singleton configuration class to get and parse the binning configuration from the catalog services endpoint
Class Method Summary collapse
Class Method Details
.get_facet_bin(facet_name) ⇒ Object
16 17 18 |
# File 'lib/search_solr_tools/helpers/facet_configuration.rb', line 16 def self.get_facet_bin(facet_name) @bin_configuration.select { |x| x['facet_name'] == facet_name }.sort_by! { |x| x['order_value'] } end |
.import_bin_configuration(env) ⇒ Object
12 13 14 |
# File 'lib/search_solr_tools/helpers/facet_configuration.rb', line 12 def self.import_bin_configuration(env) @bin_configuration = JSON.parse(RestClient.get("#{SolrEnvironments[env][:nsidc_dataset_metadata_url]}binConfiguration")) if @bin_configuration.nil? end |