Class: Actionizer::Result
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Actionizer::Result
- Defined in:
- lib/actionizer/result.rb
Instance Method Summary collapse
- #fail ⇒ Object
- #failure? ⇒ Boolean
-
#initialize(initial_hash = {}) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(initial_hash = {}) ⇒ Result
Returns a new instance of Result.
6 7 8 9 |
# File 'lib/actionizer/result.rb', line 6 def initialize(initial_hash = {}) @success = true super(initial_hash) end |
Instance Method Details
#fail ⇒ Object
19 20 21 |
# File 'lib/actionizer/result.rb', line 19 def fail @success = false end |
#failure? ⇒ Boolean
15 16 17 |
# File 'lib/actionizer/result.rb', line 15 def failure? !@success end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/actionizer/result.rb', line 11 def success? @success end |