class Ector::Multi::Operation::Base

Attributes

name[R]

Public Class Methods

new(name, block) click to toggle source
# File lib/ector-multi/operations.rb, line 9
def initialize(name, block)
  @name = name
  @block = block
end

Public Instance Methods

fail_fast?() click to toggle source
# File lib/ector-multi/operations.rb, line 26
def fail_fast?
  self.is_a?(Ector::Multi::Operation::Error)
end
inspect() click to toggle source
# File lib/ector-multi/operations.rb, line 14
def inspect
  "#<#{self.class.name} #{@name}>"
end
run(results) click to toggle source
# File lib/ector-multi/operations.rb, line 18
def run(results)
  output = @block.(results)

  perform(output)
rescue Ector::Multi::Rollback => error
  raise Ector::Multi::OperationFailure.new(self, output, error)
end

Private Instance Methods

perform(_output) click to toggle source
# File lib/ector-multi/operations.rb, line 32
def perform(_output)
  raise NotImplemented
end