Class: Orc::Result
Overview
Abstract base class for a result returned from some computation
Defined Under Namespace
Class Method Summary collapse
-
.failure(object, status = :failure) ⇒ Success
Create a result indicating failure.
-
.success(object, status = :success) ⇒ Success
Create a result indicating success.
Instance Method Summary collapse
Class Method Details
Instance Method Details
#failure? ⇒ Boolean
43 44 45 |
# File 'lib/orc.rb', line 43 def failure? !success? end |
#update ⇒ Object
47 48 49 |
# File 'lib/orc.rb', line 47 def update self.class.new(yield(object), status) end |