Sha256: ff91fd0787b44735669d469a1bc0718225997ff8958d4b95b85bc48504ee9f64
Contents?: true
Size: 651 Bytes
Versions: 43
Compression:
Stored size: 651 Bytes
Contents
require 'solrizer' module Ddr::Index class Field < SimpleDelegator attr_reader :base def initialize(base, *args) @base = base.to_s name = if args.empty? @base elsif args.last.is_a?(Hash) && args.last[:solr_name] args.last[:solr_name] else Solrizer.solr_name(base, *args) end super(name) end def label I18n.t "#{i18n_base}.label", default: base.titleize end def heading I18n.t "#{i18n_base}.heading", default: base end private def i18n_base "ddr.index.fields.#{base}" end end end
Version data entries
43 entries across 43 versions & 1 rubygems
Version | Path |
---|---|
ddr-core-0.3.0 | lib/ddr/index/field.rb |
ddr-core-0.2.2 | lib/ddr/index/field.rb |
ddr-core-0.2.1 | lib/ddr/index/field.rb |