Sha256: f5233674f905fc1516b210d1212ff23dbd3603f90507006708d24e0af807250d

Contents?: true

Size: 541 Bytes

Versions: 19

Compression:

Stored size: 541 Bytes

Contents

module Blacklight
  class Configuration::SolrField < OpenStructWithHashAccess
    def normalize! blacklight_config = nil
      self.label ||= default_label
      self.if = true if self.if.nil?
      self.unless = false if self.unless.nil?
      self
    end
  
    def validate!
      raise ArgumentError.new("Must supply a solr field name") if self.field.nil?
    end

    def default_label
      if self.field.respond_to?(:titleize)
        self.field.try(:titleize)
      else
        self.field.to_s.titleize
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
blacklight-5.9.4 lib/blacklight/configuration/solr_field.rb
blacklight-5.9.3 lib/blacklight/configuration/solr_field.rb
blacklight-5.9.2 lib/blacklight/configuration/solr_field.rb
blacklight-5.9.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.9.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.8.2 lib/blacklight/configuration/solr_field.rb
blacklight-5.8.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.8.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.7.2 lib/blacklight/configuration/solr_field.rb
blacklight-5.5.4 lib/blacklight/configuration/solr_field.rb
blacklight-5.7.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.7.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.6.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.5.3 lib/blacklight/configuration/solr_field.rb
blacklight-5.5.2 lib/blacklight/configuration/solr_field.rb
blacklight-5.5.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.5.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.4.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.4.0.rc1 lib/blacklight/configuration/solr_field.rb