Class: ReSorcery::Maybe::Nothing
- Inherits:
-
Object
- Object
- ReSorcery::Maybe::Nothing
- Includes:
- Fielded
- Defined in:
- lib/re_sorcery/maybe/nothing.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #and_then ⇒ Object
- #as_json ⇒ Object
- #assign(_name) ⇒ Object
- #get_or_else(&block) ⇒ Object
- #map ⇒ Object
- #or_else(&block) ⇒ Object
Methods included from Fielded
Instance Method Details
#==(other) ⇒ Object
30 31 32 |
# File 'lib/re_sorcery/maybe/nothing.rb', line 30 def ==(other) other.class == Nothing end |
#and_then ⇒ Object
10 11 12 |
# File 'lib/re_sorcery/maybe/nothing.rb', line 10 def and_then self end |
#as_json ⇒ Object
34 35 36 37 38 |
# File 'lib/re_sorcery/maybe/nothing.rb', line 34 def as_json(*) { kind: :nothing, } end |
#assign(_name) ⇒ Object
26 27 28 |
# File 'lib/re_sorcery/maybe/nothing.rb', line 26 def assign(_name) self end |
#get_or_else(&block) ⇒ Object
22 23 24 |
# File 'lib/re_sorcery/maybe/nothing.rb', line 22 def get_or_else(&block) block.call end |
#map ⇒ Object
14 15 16 |
# File 'lib/re_sorcery/maybe/nothing.rb', line 14 def map self end |