Class: Flock::SelectOperation
- Inherits:
-
Object
- Object
- Flock::SelectOperation
show all
- Includes:
- Enumerable, Mixins::Sizeable
- Defined in:
- lib/flock/operations/select_operation.rb
Instance Method Summary
collapse
#any?, #empty?
Constructor Details
Returns a new instance of SelectOperation.
10
11
12
13
|
# File 'lib/flock/operations/select_operation.rb', line 10
def initialize(client)
@client = client
@service = client.service
end
|
Instance Method Details
#difference(*args) ⇒ Object
25
26
27
28
|
# File 'lib/flock/operations/select_operation.rb', line 25
def difference(*args)
other = _operation_from_args(args)
ComplexOperation.new(@client, Edges::SelectOperationType::Difference, self, other)
end
|
#get_results(page) ⇒ Object
30
31
32
|
# File 'lib/flock/operations/select_operation.rb', line 30
def get_results(page)
@service.select(to_thrift, page)
end
|
#intersect(*args) ⇒ Object
15
16
17
18
|
# File 'lib/flock/operations/select_operation.rb', line 15
def intersect(*args)
other = _operation_from_args(args)
ComplexOperation.new(@client, Edges::SelectOperationType::Intersection, self, other)
end
|
#operation ⇒ Object
38
39
40
41
42
43
|
# File 'lib/flock/operations/select_operation.rb', line 38
def operation
Flock::Operation.new do |page|
results = get_results(page)
[results.ids.unpack("Q*"), results.next_cursor, results.prev_cursor]
end
end
|
#size ⇒ Object
34
35
36
|
# File 'lib/flock/operations/select_operation.rb', line 34
def size
@service.count(to_thrift)
end
|
#union(*args) ⇒ Object
20
21
22
23
|
# File 'lib/flock/operations/select_operation.rb', line 20
def union(*args)
other = _operation_from_args(args)
ComplexOperation.new(@client, Edges::SelectOperationType::Union, self, other)
end
|