Module: None
- Extended by:
- None
- Includes:
- Option
- Included in:
- None
- Defined in:
- lib/optional/none.rb
Instance Method Summary
collapse
Methods included from Option
[], #match
#detect, #flat_map, #flatten, #grep, #juxt, #map, #map_through, #reduce, #reject, #select, #to_ary
Instance Method Details
#&(other) ⇒ Object
24
25
26
|
# File 'lib/optional/none.rb', line 24
def & other
self
end
|
#each ⇒ Object
5
6
|
# File 'lib/optional/none.rb', line 5
def each
end
|
#merge(other) ⇒ Object
36
37
38
|
# File 'lib/optional/none.rb', line 36
def merge other
other
end
|
#none? ⇒ Boolean
8
9
10
|
# File 'lib/optional/none.rb', line 8
def none?
true
end
|
#some?(type = nil) ⇒ Boolean
12
13
14
|
# File 'lib/optional/none.rb', line 12
def some?(type=nil)
false
end
|
#to_s ⇒ Object
32
33
34
|
# File 'lib/optional/none.rb', line 32
def to_s
"None"
end
|
#value_or(default = nil, &block) ⇒ Object
20
21
22
|
# File 'lib/optional/none.rb', line 20
def value_or(default=nil, &block)
block.nil? ? default : block.call
end
|
#|(other) ⇒ Object
28
29
30
|
# File 'lib/optional/none.rb', line 28
def | other
other
end
|