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.
2071 2072 2073 2074 2075 |
# File 'lib/warg.rb', line 2071 def initialize(outcome) @last_outcome = outcome @host = @last_outcome.host @successful = true end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
2066 2067 2068 |
# File 'lib/warg.rb', line 2066 def error @error end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
2067 2068 2069 |
# File 'lib/warg.rb', line 2067 def host @host end |
#last_outcome ⇒ Object (readonly)
Returns the value of attribute last_outcome.
2068 2069 2070 |
# File 'lib/warg.rb', line 2068 def last_outcome @last_outcome end |
#value ⇒ Object
Returns the value of attribute value.
2069 2070 2071 |
# File 'lib/warg.rb', line 2069 def value @value end |
Instance Method Details
#fail!(message) ⇒ Object
2081 2082 2083 2084 2085 |
# File 'lib/warg.rb', line 2081 def fail!() @successful = false raise CallbackFailedError.new() end |
#failed? ⇒ Boolean
2096 2097 2098 |
# File 'lib/warg.rb', line 2096 def failed? !successful? end |
#failure_reason ⇒ Object
2100 2101 2102 |
# File 'lib/warg.rb', line 2100 def failure_reason error end |
#failure_summary ⇒ Object
2104 2105 2106 |
# File 'lib/warg.rb', line 2104 def failure_summary error && error. end |
#resolve(value) ⇒ Object
2077 2078 2079 |
# File 'lib/warg.rb', line 2077 def resolve(value) @value = value end |
#successful? ⇒ Boolean
2092 2093 2094 |
# File 'lib/warg.rb', line 2092 def successful? @successful end |