Class: RFunk::None

Inherits:
Option show all
Includes:
Singleton
Defined in:
lib/rfunk/maybe/none.rb

Instance Method Summary collapse

Methods inherited from Option

#each

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *arguments, &block) ⇒ Object



13
14
15
# File 'lib/rfunk/maybe/none.rb', line 13

def method_missing(method, *arguments, &block)
  self
end

Instance Method Details

#coerce(other) ⇒ Object



17
18
19
# File 'lib/rfunk/maybe/none.rb', line 17

def coerce(other)
  [other, 0]
end

#or(other) ⇒ Object



9
10
11
# File 'lib/rfunk/maybe/none.rb', line 9

def or(other)
  Option(other)
end

#to_aryObject



25
26
27
# File 'lib/rfunk/maybe/none.rb', line 25

def to_ary
  []
end

#to_hashObject



29
30
31
# File 'lib/rfunk/maybe/none.rb', line 29

def to_hash
  {}
end

#to_strObject



21
22
23
# File 'lib/rfunk/maybe/none.rb', line 21

def to_str
  ''
end

#value(default = None()) ⇒ Object



5
6
7
# File 'lib/rfunk/maybe/none.rb', line 5

def value(default = None())
  Option(default)
end