Class: Sonic::Channels::Ingest

Inherits:
Base
  • Object
show all
Defined in:
lib/sonic/channels/ingest.rb

Instance Attribute Summary

Attributes inherited from Base

#connection

Instance Method Summary collapse

Methods inherited from Base

#help, #initialize, #ping, #quit

Constructor Details

This class inherits a constructor from Sonic::Channels::Base

Instance Method Details

#count(collection, bucket = nil, object = nil) ⇒ Object



15
16
17
# File 'lib/sonic/channels/ingest.rb', line 15

def count(collection, bucket = nil, object = nil)
  execute('COUNT', *[collection, bucket, object].compact)
end

#flushb(collection, bucket) ⇒ Object



23
24
25
# File 'lib/sonic/channels/ingest.rb', line 23

def flushb(collection, bucket)
  execute('FLUSHB', collection, bucket)
end

#flushc(collection) ⇒ Object



19
20
21
# File 'lib/sonic/channels/ingest.rb', line 19

def flushc(collection)
  execute('FLUSHC', collection)
end

#flusho(collection, bucket, object) ⇒ Object



27
28
29
# File 'lib/sonic/channels/ingest.rb', line 27

def flusho(collection, bucket, object)
  execute('FLUSHO', collection, bucket, object)
end

#pop(collection, bucket, object, text) ⇒ Object



11
12
13
# File 'lib/sonic/channels/ingest.rb', line 11

def pop(collection, bucket, object, text)
  execute('POP', collection, bucket, object, quote(text))
end

#push(collection, bucket, object, text, lang = nil) ⇒ Object



4
5
6
7
8
9
# File 'lib/sonic/channels/ingest.rb', line 4

def push(collection, bucket, object, text, lang = nil)
  arr = [collection, bucket, object, quote(text)]
  arr << "LANG(#{lang})" if lang

  execute('PUSH', *arr)
end