Class: Errgonomic::Option::Some
- Defined in:
- lib/errgonomic/option.rb,
lib/errgonomic/rails/active_record_optional.rb
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, #to_json, #to_s, #unwrap!, #unwrap_or, #unwrap_or_else, #zip, #zip_with
Constructor Details
#initialize(value) ⇒ Some
Returns a new instance of Some.
359 360 361 |
# File 'lib/errgonomic/option.rb', line 359 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
357 358 359 |
# File 'lib/errgonomic/option.rb', line 357 def value @value end |
Instance Method Details
#none? ⇒ Boolean
367 368 369 |
# File 'lib/errgonomic/option.rb', line 367 def none? false end |
#some? ⇒ Boolean
363 364 365 |
# File 'lib/errgonomic/option.rb', line 363 def some? true end |