Module: RSolr::Ext::Model
- Defined in:
- lib/rsolr-ext/model.rb
Overview
Defined Under Namespace
Instance Attribute Summary collapse
-
#_source ⇒ Object
readonly
The original object passed in to the #new method.
Class Method Summary collapse
-
.included(base) ⇒ Object
Called by Ruby Module API extends this class object.
Instance Method Summary collapse
-
#initialize(source_doc = {}) ⇒ Object
Constructor **for the class that is getting this module included** source_doc should be a hash or something similar calls each of after_initialize blocks.
-
#method_missing(m, *args, &b) ⇒ Object
the wrapper method to the @_source object.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &b) ⇒ Object
the wrapper method to the @_source object. If a method is missing, it gets sent to @_source with all of the original params and block
95 96 97 |
# File 'lib/rsolr-ext/model.rb', line 95 def method_missing(m, *args, &b) @_source.send(m, *args, &b) end |
Instance Attribute Details
#_source ⇒ Object (readonly)
The original object passed in to the #new method
80 81 82 |
# File 'lib/rsolr-ext/model.rb', line 80 def _source @_source end |
Class Method Details
Instance Method Details
#initialize(source_doc = {}) ⇒ Object
Constructor **for the class that is getting this module included** source_doc should be a hash or something similar calls each of after_initialize blocks
85 86 87 88 89 90 |
# File 'lib/rsolr-ext/model.rb', line 85 def initialize(source_doc={}) @_source = source_doc.to_mash self.class.hooks.each do |h| instance_eval &h end end |