Class: Errgonomic::Result::Ok

Inherits:
Any show all
Defined in:
lib/errgonomic/result.rb

Overview

The Ok variant.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Any

#==, #and, #and_then, #err_and?, #expect!, #initialize, #ok_and?, #or, #or_else, #result?, #unwrap!, #unwrap_err!, #unwrap_or, #unwrap_or_else

Constructor Details

This class inherits a constructor from Errgonomic::Result::Any

Instance Attribute Details

#valueObject

Returns the value of attribute value.



226
227
228
# File 'lib/errgonomic/result.rb', line 226

def value
  @value
end

Instance Method Details

#err?Boolean

Ok is never err

Examples:

Ok(1).err? # => false

Returns:

  • (Boolean)


240
241
242
# File 'lib/errgonomic/result.rb', line 240

def err?
  false
end

#ok?Boolean

Ok is always ok

Examples:

Ok(1).ok? # => true

Returns:

  • (Boolean)


232
233
234
# File 'lib/errgonomic/result.rb', line 232

def ok?
  true
end