Class: Warg::Command::Step::Callback::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.



1981
1982
1983
1984
1985
# File 'lib/warg.rb', line 1981

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

Instance Attribute Details

#errorObject

Returns the value of attribute error.



1976
1977
1978
# File 'lib/warg.rb', line 1976

def error
  @error
end

#hostObject (readonly)

Returns the value of attribute host.



1977
1978
1979
# File 'lib/warg.rb', line 1977

def host
  @host
end

#last_outcomeObject (readonly)

Returns the value of attribute last_outcome.



1978
1979
1980
# File 'lib/warg.rb', line 1978

def last_outcome
  @last_outcome
end

#valueObject

Returns the value of attribute value.



1979
1980
1981
# File 'lib/warg.rb', line 1979

def value
  @value
end

Instance Method Details

#fail!(message) ⇒ Object



1991
1992
1993
1994
1995
# File 'lib/warg.rb', line 1991

def fail!(message)
  @successful = false

  raise CallbackFailedError.new(message)
end

#failed?Boolean

Returns:

  • (Boolean)


2006
2007
2008
# File 'lib/warg.rb', line 2006

def failed?
  !successful?
end

#failure_reasonObject



2010
2011
2012
# File 'lib/warg.rb', line 2010

def failure_reason
  error
end

#failure_summaryObject



2014
2015
2016
# File 'lib/warg.rb', line 2014

def failure_summary
  error && error.full_message
end

#resolve(value) ⇒ Object



1987
1988
1989
# File 'lib/warg.rb', line 1987

def resolve(value)
  @value = value
end

#successful?Boolean

Returns:

  • (Boolean)


2002
2003
2004
# File 'lib/warg.rb', line 2002

def successful?
  @successful
end