Class: OrElse::NothingClass
- Includes:
- Singleton
- Defined in:
- lib/or_else/nothing_class.rb
Instance Method Summary collapse
- #all? ⇒ Boolean
- #any? ⇒ Boolean
- #each ⇒ Object
- #empty? ⇒ Boolean
- #exists? ⇒ Boolean
- #filter ⇒ Object
- #flat_map ⇒ Object
- #map ⇒ Object
- #nil? ⇒ Boolean
- #or_else ⇒ Object
- #present? ⇒ Boolean
Methods inherited from Maybe
Instance Method Details
#all? ⇒ Boolean
42 43 44 |
# File 'lib/or_else/nothing_class.rb', line 42 def all? true end |
#any? ⇒ Boolean
46 47 48 |
# File 'lib/or_else/nothing_class.rb', line 46 def any? all? end |
#each ⇒ Object
39 40 |
# File 'lib/or_else/nothing_class.rb', line 39 def each end |
#empty? ⇒ Boolean
19 20 21 |
# File 'lib/or_else/nothing_class.rb', line 19 def empty? true end |
#exists? ⇒ Boolean
27 28 29 |
# File 'lib/or_else/nothing_class.rb', line 27 def exists? !empty? end |
#nil? ⇒ Boolean
23 24 25 |
# File 'lib/or_else/nothing_class.rb', line 23 def nil? empty? end |
#or_else ⇒ Object
35 36 37 |
# File 'lib/or_else/nothing_class.rb', line 35 def or_else yield end |
#present? ⇒ Boolean
31 32 33 |
# File 'lib/or_else/nothing_class.rb', line 31 def present? exists? end |