Class: Flock::ComplexOperation

Inherits:
SelectOperation show all
Defined in:
lib/flock/operations/complex_operation.rb

Instance Method Summary collapse

Methods inherited from SelectOperation

#difference, #get_results, #intersect, #operation, #size, #union

Methods included from Mixins::Sizeable

#any?, #empty?

Constructor Details

#initialize(client, operation_type, operand1, operand2) ⇒ ComplexOperation

Returns a new instance of ComplexOperation.



3
4
5
6
# File 'lib/flock/operations/complex_operation.rb', line 3

def initialize(client, operation_type, operand1, operand2)
  super(client)
  @operation_type, @operand1, @operand2 = operation_type, operand1, operand2
end

Instance Method Details

#to_thriftObject



8
9
10
11
12
13
# File 'lib/flock/operations/complex_operation.rb', line 8

def to_thrift
  operation = Edges::SelectOperation.new
  operation.operation_type = @operation_type
  operation.term = nil
  @operand1.to_thrift + @operand2.to_thrift + Array(operation)
end