Class: Flock::ExecuteOperations

Inherits:
Object
  • Object
show all
Defined in:
lib/flock/operations/execute_operations.rb

Instance Method Summary collapse

Constructor Details

#initialize(service, priority, execute_at = nil) ⇒ ExecuteOperations

Returns a new instance of ExecuteOperations.



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

def initialize(service, priority, execute_at = nil)
  @service, @operations, @priority, @execute_at = service, [], priority, execute_at
end

Instance Method Details

#applyObject



17
18
19
# File 'lib/flock/operations/execute_operations.rb', line 17

def apply
  @service.execute(to_thrift)
end

#to_thriftObject



21
22
23
24
25
26
27
# File 'lib/flock/operations/execute_operations.rb', line 21

def to_thrift
  operations = Edges::ExecuteOperations.new
  operations.operations = @operations.map(&:to_thrift)
  operations.priority = @priority
  operations.execute_at = @execute_at.to_i if @execute_at
  operations
end