Sha256: 50a23fa23f53dcb0d5d71ae3a9841cb0ea9d0a690ca85286980f72422e395333

Contents?: true

Size: 459 Bytes

Versions: 26

Compression:

Stored size: 459 Bytes

Contents

module Blacklight
  class Configuration::SolrField < OpenStructWithHashAccess
    def normalize! blacklight_config = nil
      self.label ||= default_label
      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

26 entries across 26 versions & 1 rubygems

Version Path
blacklight-4.9.0 lib/blacklight/configuration/solr_field.rb
blacklight-4.8.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.3.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.3 lib/blacklight/configuration/solr_field.rb
blacklight-5.1.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.2.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.1.0 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.2 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.0 lib/blacklight/configuration/solr_field.rb
blacklight-4.7.0 lib/blacklight/configuration/solr_field.rb
blacklight-4.7.0.pre1 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.0.pre4 lib/blacklight/configuration/solr_field.rb
blacklight-4.6.3 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.0.pre3 lib/blacklight/configuration/solr_field.rb
blacklight-4.6.2 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.0.pre2 lib/blacklight/configuration/solr_field.rb
blacklight-4.6.1 lib/blacklight/configuration/solr_field.rb
blacklight-5.0.0.pre1 lib/blacklight/configuration/solr_field.rb
blacklight-4.6.0 lib/blacklight/configuration/solr_field.rb