Sha256: 5f19e8877e091342678d5d49d24a33a6996ae32bc611a930db2569c3a09e7215
Contents?: true
Size: 589 Bytes
Versions: 31
Compression:
Stored size: 589 Bytes
Contents
module Blacklight class Configuration::Field < OpenStructWithHashAccess def normalize! blacklight_config = nil self.field ||= self.key self.key ||= self.field 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 field name") if self.field.nil? end def default_label if self.key.respond_to?(:titleize) self.key.try(:titleize) else self.key.to_s.titleize end end end end
Version data entries
31 entries across 31 versions & 1 rubygems