Class: Plutonium::Interaction::Outcome::Failure
- Inherits:
-
Plutonium::Interaction::Outcome
- Object
- Plutonium::Interaction::Outcome
- Plutonium::Interaction::Outcome::Failure
- Defined in:
- lib/plutonium/interaction/outcome.rb
Overview
Represents a failed outcome of an interaction.
Instance Method Summary collapse
-
#and_then ⇒ self
Returns self without executing the given block, propagating the failure.
-
#to_response ⇒ Plutonium::Interaction::Response::Null
Converts this failure outcome to a response object.
-
#with_message(msg, type = :alert) ⇒ self
Adds a message to the outcome.
-
#with_response(response) ⇒ self
Returns self without setting a response.
Methods inherited from Plutonium::Interaction::Outcome
#failure?, #messages, #success?
Instance Method Details
#and_then ⇒ self
Returns self without executing the given block, propagating the failure.
128 129 130 |
# File 'lib/plutonium/interaction/outcome.rb', line 128 def and_then self end |
#to_response ⇒ Plutonium::Interaction::Response::Null
Converts this failure outcome to a response object.
142 143 144 145 146 147 |
# File 'lib/plutonium/interaction/outcome.rb', line 142 def to_response @to_response ||= begin @response ||= Response::Failure.new @response.with_flash() end end |
#with_message(msg, type = :alert) ⇒ self
Adds a message to the outcome.
121 122 123 |
# File 'lib/plutonium/interaction/outcome.rb', line 121 def (msg, type = :alert) super end |
#with_response(response) ⇒ self
Returns self without setting a response.
135 136 137 |
# File 'lib/plutonium/interaction/outcome.rb', line 135 def with_response(response) self end |