Class: Errgonomic::Option::None
- Defined in:
- lib/errgonomic/option.rb,
lib/errgonomic/rails/active_record_optional.rb
Overview
A None answers nil? like nil itself, so ActiveRecord internals that check for nil treat an absent value as absent.
Constant Summary
Constants inherited from Any
Any::NUDGED, Any::RUST_SPELLINGS
Instance Method Summary collapse
-
#initialize ⇒ None
constructor
A new instance of None.
- #inspect ⇒ Object
- #nil? ⇒ Boolean
- #none? ⇒ Boolean
- #some? ⇒ Boolean
Methods inherited from Any
#!=, #<=>, #==, #===, #and, #and_then, #as_json, #blank?, #blank_or, #blank_or_else, #blank_or_raise!, #deconstruct, #each, #eql?, #expect!, #filter, #flatten, #hash, #map, #map_or, #map_or_else, #method_missing, #none_or, #ok_or, #ok_or_else, #or, #or_else, #presence, #present?, #present_or, #present_or_else, #present_or_raise!, #pretty_print, #respond_to_missing?, #some_and, #tap_some, #to_a, #to_json, #to_option, #to_s, #try, #try!, #unwrap!, #unwrap_or, #unwrap_or_else, #xor, #zip, #zip_with
Constructor Details
#initialize ⇒ None
Returns a new instance of None.
1005 1006 1007 1008 |
# File 'lib/errgonomic/option.rb', line 1005 def initialize super freeze end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Errgonomic::Option::Any
Instance Method Details
#inspect ⇒ Object
1020 1021 1022 |
# File 'lib/errgonomic/option.rb', line 1020 def inspect 'None' end |
#nil? ⇒ Boolean
433 434 435 |
# File 'lib/errgonomic/rails/active_record_optional.rb', line 433 def nil? true end |
#none? ⇒ Boolean
1014 1015 1016 |
# File 'lib/errgonomic/option.rb', line 1014 def none? true end |
#some? ⇒ Boolean
1010 1011 1012 |
# File 'lib/errgonomic/option.rb', line 1010 def some? false end |