Class: Errgonomic::Option::Some
Overview
Represent a value
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Some
constructor
A new instance of Some.
- #none? ⇒ Boolean
- #some? ⇒ Boolean
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
#value ⇒ Object
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
333 334 335 |
# File 'lib/errgonomic/option.rb', line 333 def none? false end |
#some? ⇒ Boolean
329 330 331 |
# File 'lib/errgonomic/option.rb', line 329 def some? true end |