Class: Nothing

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/just_maybe/nothing.rb

Instance Method Summary collapse

Constructor Details

#initializeNothing

Returns a new instance of Nothing.



6
7
# File 'lib/just_maybe/nothing.rb', line 6

def initialize
end

Instance Method Details

#nothing?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/just_maybe/nothing.rb', line 9

def nothing?
  true
end

#something?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/just_maybe/nothing.rb', line 13

def something?
  false
end

#to_sObject



20
21
22
# File 'lib/just_maybe/nothing.rb', line 20

def to_s
  "Nothing"
end

#tryObject



17
18
# File 'lib/just_maybe/nothing.rb', line 17

def try
end