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.



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

#errorObject

Returns the value of attribute error.



2066
2067
2068
# File 'lib/warg.rb', line 2066

def error
  @error
end

#hostObject (readonly)

Returns the value of attribute host.



2067
2068
2069
# File 'lib/warg.rb', line 2067

def host
  @host
end

#last_outcomeObject (readonly)

Returns the value of attribute last_outcome.



2068
2069
2070
# File 'lib/warg.rb', line 2068

def last_outcome
  @last_outcome
end

#valueObject

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!(message)
  @successful = false

  raise CallbackFailedError.new(message)
end

#failed?Boolean

Returns:

  • (Boolean)


2096
2097
2098
# File 'lib/warg.rb', line 2096

def failed?
  !successful?
end

#failure_reasonObject



2100
2101
2102
# File 'lib/warg.rb', line 2100

def failure_reason
  error
end

#failure_summaryObject



2104
2105
2106
# File 'lib/warg.rb', line 2104

def failure_summary
  error && error.full_message
end

#resolve(value) ⇒ Object



2077
2078
2079
# File 'lib/warg.rb', line 2077

def resolve(value)
  @value = value
end

#successful?Boolean

Returns:

  • (Boolean)


2092
2093
2094
# File 'lib/warg.rb', line 2092

def successful?
  @successful
end