Class: Ector::Multi::OperationFailure

Inherits:
Rollback
  • Object
show all
Defined in:
lib/ector-multi/errors.rb

Direct Known Subclasses

ControlledFailure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation, arguments, caused_by) ⇒ OperationFailure

Returns a new instance of OperationFailure.



15
16
17
18
19
20
21
# File 'lib/ector-multi/errors.rb', line 15

def initialize(operation, arguments, caused_by)
  @operation = operation
  @arguments = arguments
  @caused_by = caused_by

  super("Rollback fired by #{operation.name}")
end

Instance Attribute Details

#argumentsObject (readonly) Also known as: value

Returns the value of attribute arguments.



12
13
14
# File 'lib/ector-multi/errors.rb', line 12

def arguments
  @arguments
end

#caused_byObject (readonly)

Returns the value of attribute caused_by.



12
13
14
# File 'lib/ector-multi/errors.rb', line 12

def caused_by
  @caused_by
end

#operationObject (readonly)

Returns the value of attribute operation.



12
13
14
# File 'lib/ector-multi/errors.rb', line 12

def operation
  @operation
end

Instance Method Details

#inspectObject



23
24
25
# File 'lib/ector-multi/errors.rb', line 23

def inspect
  "#<#{self.class.name} #{@operation.name} @caused_by=#{@caused_by.class} @arguments=#{@arguments}>"
end