Class: Logicall::Result

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/logicall/result.rb

Overview

Represents the result with all the values, the result is considered success by default.

Instance Method Summary collapse

Instance Method Details

#fail!Object

Marks the result as a failure.



17
18
19
# File 'lib/logicall/result.rb', line 17

def fail!
  @failure = true
end

#failure?Boolean

Indicates whether the result is a failure or not

Returns:

  • (Boolean)


12
13
14
# File 'lib/logicall/result.rb', line 12

def failure?
  @failure || false
end

#success?Boolean

Indicates whether the result is a success or not.

Returns:

  • (Boolean)


7
8
9
# File 'lib/logicall/result.rb', line 7

def success?
  !failure?
end