Exception: Legion::Gaia::Workflow::GuardRejected

Inherits:
Error
  • Object
show all
Defined in:
lib/legion/gaia/workflow/errors.rb

Overview

Raised when a transition guard returns false

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, guard_name = nil) ⇒ GuardRejected

Returns a new instance of GuardRejected.



24
25
26
27
28
29
30
# File 'lib/legion/gaia/workflow/errors.rb', line 24

def initialize(from, to, guard_name = nil)
  @from = from
  @to = to
  @guard_name = guard_name
  label = guard_name ? " (guard: #{guard_name})" : ''
  super("Transition from #{from.inspect} to #{to.inspect} rejected by guard#{label}")
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



22
23
24
# File 'lib/legion/gaia/workflow/errors.rb', line 22

def from
  @from
end

#guard_nameObject (readonly)

Returns the value of attribute guard_name.



22
23
24
# File 'lib/legion/gaia/workflow/errors.rb', line 22

def guard_name
  @guard_name
end

#toObject (readonly)

Returns the value of attribute to.



22
23
24
# File 'lib/legion/gaia/workflow/errors.rb', line 22

def to
  @to
end