Class: Monadic::None
- Inherits:
-
Object
- Object
- Monadic::None
- Defined in:
- lib/monadic/option.rb
Overview
Represents the Option if there is no value available
Class Method Summary collapse
- .empty? ⇒ Boolean
- .fetch(default = nil) ⇒ Object (also: or, _)
- .method_missing(m, *args) ⇒ Object
- .to_ary ⇒ Object (also: to_a)
- .to_s ⇒ Object
- .truly? ⇒ Boolean
Class Method Details
.empty? ⇒ Boolean
76 77 78 |
# File 'lib/monadic/option.rb', line 76 def empty? true end |
.fetch(default = nil) ⇒ Object Also known as: or, _
80 81 82 83 |
# File 'lib/monadic/option.rb', line 80 def fetch(default=nil) raise NoValueError if default.nil? default end |
.method_missing(m, *args) ⇒ Object
87 88 89 |
# File 'lib/monadic/option.rb', line 87 def method_missing(m, *args) self end |
.to_ary ⇒ Object Also known as: to_a
71 72 73 |
# File 'lib/monadic/option.rb', line 71 def to_ary [] end |
.to_s ⇒ Object
91 92 93 |
# File 'lib/monadic/option.rb', line 91 def to_s 'None' end |
.truly? ⇒ Boolean
95 96 97 |
# File 'lib/monadic/option.rb', line 95 def truly? false end |