Class: ThinkingSphinx::Excerpter
- Inherits:
-
Object
- Object
- ThinkingSphinx::Excerpter
- Defined in:
- lib/thinking_sphinx/excerpter.rb
Constant Summary
- CoreMethods =
%w( kind_of? object_id respond_to? respond_to_missing? should should_not stub! )
Instance Method Summary (collapse)
-
- (Excerpter) initialize(search, instance)
constructor
A new instance of Excerpter.
- - (Object) method_missing(method, *args, &block)
Constructor Details
- (Excerpter) initialize(search, instance)
A new instance of Excerpter
12 13 14 15 |
# File 'lib/thinking_sphinx/excerpter.rb', line 12 def initialize(search, instance) @search = search @instance = instance end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *args, &block)
17 18 19 20 21 |
# File 'lib/thinking_sphinx/excerpter.rb', line 17 def method_missing(method, *args, &block) string = @instance.send(method, *args, &block).to_s @search.excerpt_for(string, @instance.class) end |