Class: Flock::ExecuteOperations
- Inherits:
-
Object
- Object
- Flock::ExecuteOperations
- Defined in:
- lib/flock/operations/execute_operations.rb
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(service, priority, execute_at = nil) ⇒ ExecuteOperations
constructor
A new instance of ExecuteOperations.
- #to_thrift ⇒ Object
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
#apply ⇒ Object
17 18 19 |
# File 'lib/flock/operations/execute_operations.rb', line 17 def apply @service.execute(to_thrift) end |
#to_thrift ⇒ Object
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 |