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, #map, #ok_and?, #or, #or_else, #result?, #tap_err, #tap_ok, #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.



261
262
263
# File 'lib/errgonomic/result.rb', line 261

def value
  @value
end

Instance Method Details

#err?Boolean

Ok is never err

Examples:

Ok(1).err? # => false

Returns:

  • (Boolean)


275
276
277
# File 'lib/errgonomic/result.rb', line 275

def err?
  false
end

#ok?Boolean

Ok is always ok

Examples:

Ok(1).ok? # => true

Returns:

  • (Boolean)


267
268
269
# File 'lib/errgonomic/result.rb', line 267

def ok?
  true
end