Class: ActiveRecordSunspotter::SunspotColumn
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ActiveRecordSunspotter::SunspotColumn
- Defined in:
- lib/active_record_sunspotter/sunspot_column.rb
Instance Method Summary collapse
- #hash_table ⇒ Object
-
#initialize(*args) ⇒ SunspotColumn
constructor
A new instance of SunspotColumn.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ SunspotColumn
Returns a new instance of SunspotColumn.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/active_record_sunspotter/sunspot_column.rb', line 4 def initialize(*args) # some sensible defaults = { :type => :string, :orderable => true, :facetable => false, :filterable => false, :multiple => false, :default => false } = args..with_indifferent_access if [String,Symbol].include?( args.first.class ) and !.has_key?(:name) [:name] = args.first.to_s end # if( options[:type] == :null_yndk_string ) && options[:meth].blank? # options[:meth] = ->(s){ YNDK[s.send(:name)]||'NULL' } # options[:type] = :string # end .update() # default_options[:orderable] = false if options[:type] == :multistring [:orderable] = false if [:multiple] [:filterable] = true if [:facetable] super end |
Instance Method Details
#hash_table ⇒ Object
31 32 33 |
# File 'lib/active_record_sunspotter/sunspot_column.rb', line 31 def hash_table instance_variable_get("@table") end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/active_record_sunspotter/sunspot_column.rb', line 35 def to_s name end |