Module: SimpleSolr::Update::ClassMethods
- Defined in:
- lib/simple_solr/update.rb
Instance Method Summary collapse
-
#field(name, value = nil) ⇒ Object
gets called by every
field
line inside the simple_solr block. - #simple_solr ⇒ Object
Instance Method Details
#field(name, value = nil) ⇒ Object
gets called by every field
line inside the simple_solr block. It stores the given values in simple_solr_fields
, which we later use to build the XML.
31 32 33 |
# File 'lib/simple_solr/update.rb', line 31 def field(name, value=nil) simple_solr_fields[name] = value end |
#simple_solr ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/simple_solr/update.rb', line 9 def simple_solr class_eval do # httparty include HTTParty headers 'Content-Type' => 'text/xml' # callbacks after_save :add_to_solr after_destroy :delete_from_solr end # Store the simple_solr fields for this class cattr_accessor :simple_solr_fields self.simple_solr_fields = { :id => nil } yield if block_given? include InstanceMethods end |