Class: Warg::Executor::Deferred::CallbacksQueue::Outcome

Inherits:
Object
  • Object
show all
Defined in:
lib/warg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(outcome) ⇒ Outcome

Returns a new instance of Outcome.



1703
1704
1705
1706
1707
# File 'lib/warg.rb', line 1703

def initialize(outcome)
  @source_outcome = outcome
  @host = @source_outcome.host
  @successful = true
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



1698
1699
1700
# File 'lib/warg.rb', line 1698

def error
  @error
end

#hostObject (readonly)

Returns the value of attribute host.



1699
1700
1701
# File 'lib/warg.rb', line 1699

def host
  @host
end

#source_outcomeObject (readonly)

Returns the value of attribute source_outcome.



1700
1701
1702
# File 'lib/warg.rb', line 1700

def source_outcome
  @source_outcome
end

#valueObject

Returns the value of attribute value.



1701
1702
1703
# File 'lib/warg.rb', line 1701

def value
  @value
end

Instance Method Details

#fail!(message) ⇒ Object



1713
1714
1715
1716
1717
# File 'lib/warg.rb', line 1713

def fail!(message)
  @successful = false

  raise CallbackFailedError.new(message)
end

#failed?Boolean

Returns:

  • (Boolean)


1728
1729
1730
# File 'lib/warg.rb', line 1728

def failed?
  !successful?
end

#failure_summaryObject



1732
1733
1734
# File 'lib/warg.rb', line 1732

def failure_summary
  error && error.full_message
end

#resolve(value) ⇒ Object



1709
1710
1711
# File 'lib/warg.rb', line 1709

def resolve(value)
  @value = value
end

#successful?Boolean

Returns:

  • (Boolean)


1724
1725
1726
# File 'lib/warg.rb', line 1724

def successful?
  @successful
end