Class: ThinkingSphinx::Search::Context
- Inherits:
-
Object
- Object
- ThinkingSphinx::Search::Context
- Defined in:
- lib/thinking_sphinx/search/context.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(search, configuration = nil) ⇒ Context
constructor
A new instance of Context.
- #marshal_dump ⇒ Object
- #marshal_load(array) ⇒ Object
Constructor Details
#initialize(search, configuration = nil) ⇒ Context
Returns a new instance of Context.
6 7 8 9 10 11 12 13 |
# File 'lib/thinking_sphinx/search/context.rb', line 6 def initialize(search, configuration = nil) @search = search @configuration = configuration || ThinkingSphinx::Configuration.instance @memory = { :results => [], :panes => ThinkingSphinx::Configuration::Defaults::PANES.clone } end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
4 5 6 |
# File 'lib/thinking_sphinx/search/context.rb', line 4 def configuration @configuration end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
4 5 6 |
# File 'lib/thinking_sphinx/search/context.rb', line 4 def search @search end |
Instance Method Details
#[](key) ⇒ Object
15 16 17 |
# File 'lib/thinking_sphinx/search/context.rb', line 15 def [](key) @memory[key] end |
#[]=(key, value) ⇒ Object
19 20 21 |
# File 'lib/thinking_sphinx/search/context.rb', line 19 def []=(key, value) @memory[key] = value end |
#marshal_dump ⇒ Object
23 24 25 |
# File 'lib/thinking_sphinx/search/context.rb', line 23 def marshal_dump [@memory.except(:raw, :indices)] end |
#marshal_load(array) ⇒ Object
27 28 29 |
# File 'lib/thinking_sphinx/search/context.rb', line 27 def marshal_load(array) @memory = array.first end |