Class: Nothing

Inherits:
Maybe show all
Defined in:
lib/ruby-maybe.rb

Defined Under Namespace

Classes: AttemptedExtract

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



44
45
46
# File 'lib/ruby-maybe.rb', line 44

def method_missing(method_name, *args, &block)
  Nothing.new
end

Instance Method Details

#==(object) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/ruby-maybe.rb', line 52

def ==(object)
  if object.class == Nothing
    true
  else
    false
  end
end

#_extract!Object

Raises:



60
61
62
# File 'lib/ruby-maybe.rb', line 60

def _extract!
  raise AttemptedExtract.new
end

#bindObject



48
49
50
# File 'lib/ruby-maybe.rb', line 48

def bind
  Nothing.new
end