Class: Spinel::Client
- Inherits:
-
Object
- Object
- Spinel::Client
- Defined in:
- lib/spinel/client.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #cachekey(words) ⇒ Object
- #database ⇒ Object
- #index(p) ⇒ Object
-
#initialize(type = :default) ⇒ Client
constructor
A new instance of Client.
Methods included from Searcher
#cache_enable, #search, #search_option, #search_word_split, #set_cache
Methods included from Indexer
Methods included from Helper
#document_body, #document_id, #document_score, #get_valid_document, #prefixes, #squish
Constructor Details
#initialize(type = :default) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/spinel/client.rb', line 9 def initialize type = :default @type = type end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/spinel/client.rb', line 7 def type @type end |
Instance Method Details
#cachekey(words) ⇒ Object
21 22 23 |
# File 'lib/spinel/client.rb', line 21 def cachekey words "#{Spinel.namespace}:cache:#{type}:#{words.join('|')}" end |
#database ⇒ Object
17 18 19 |
# File 'lib/spinel/client.rb', line 17 def database "#{Spinel.namespace}:data:#{type}" end |
#index(p) ⇒ Object
13 14 15 |
# File 'lib/spinel/client.rb', line 13 def index p "#{Spinel.namespace}:index:#{type}:#{p}" end |