Class: Warg::Command::Step::Callback::Outcome
- Inherits:
-
Object
- Object
- Warg::Command::Step::Callback::Outcome
- Defined in:
- lib/warg.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#last_outcome ⇒ Object
readonly
Returns the value of attribute last_outcome.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #fail!(message) ⇒ Object
- #failed? ⇒ Boolean
- #failure_reason ⇒ Object
- #failure_summary ⇒ Object
-
#initialize(outcome) ⇒ Outcome
constructor
A new instance of Outcome.
- #resolve(value) ⇒ Object
- #successful? ⇒ Boolean
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
#error ⇒ Object
Returns the value of attribute error.
1976 1977 1978 |
# File 'lib/warg.rb', line 1976 def error @error end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
1977 1978 1979 |
# File 'lib/warg.rb', line 1977 def host @host end |
#last_outcome ⇒ Object (readonly)
Returns the value of attribute last_outcome.
1978 1979 1980 |
# File 'lib/warg.rb', line 1978 def last_outcome @last_outcome end |
#value ⇒ Object
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!() @successful = false raise CallbackFailedError.new() end |
#failed? ⇒ Boolean
2006 2007 2008 |
# File 'lib/warg.rb', line 2006 def failed? !successful? end |
#failure_reason ⇒ Object
2010 2011 2012 |
# File 'lib/warg.rb', line 2010 def failure_reason error end |
#failure_summary ⇒ Object
2014 2015 2016 |
# File 'lib/warg.rb', line 2014 def failure_summary error && error. end |
#resolve(value) ⇒ Object
1987 1988 1989 |
# File 'lib/warg.rb', line 1987 def resolve(value) @value = value end |
#successful? ⇒ Boolean
2002 2003 2004 |
# File 'lib/warg.rb', line 2002 def successful? @successful end |