Class: Errgonomic::Option::Some

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

Overview

Represent a value

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Any

#==, #and, #and_then, #deconstruct, #expect!, #map, #map_or, #map_or_else, #none_or, #ok, #ok_or, #ok_or_else, #or, #or_else, #some_and, #tap_some, #to_a, #unwrap!, #unwrap_or, #unwrap_or_else, #zip, #zip_with

Constructor Details

#initialize(value) ⇒ Some

Returns a new instance of Some.



325
326
327
# File 'lib/errgonomic/option.rb', line 325

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



323
324
325
# File 'lib/errgonomic/option.rb', line 323

def value
  @value
end

Instance Method Details

#none?Boolean

Returns:

  • (Boolean)


333
334
335
# File 'lib/errgonomic/option.rb', line 333

def none?
  false
end

#some?Boolean

Returns:

  • (Boolean)


329
330
331
# File 'lib/errgonomic/option.rb', line 329

def some?
  true
end