class Maybe::Something

Attributes

value[R]

Public Class Methods

new(value) click to toggle source
# File lib/maybe/something.rb, line 3
def initialize(value)
  @value = value
end

Public Instance Methods

else()
Alias for: get
get() click to toggle source
# File lib/maybe/something.rb, line 7
def get
  value
end
Also aliased as: else
if_something(&blk) click to toggle source
# File lib/maybe/something.rb, line 13
def if_something(&blk)
  blk.(value)
  self
end
method_missing(method, *args, &blk) click to toggle source
# File lib/maybe/something.rb, line 26
def method_missing(method, *args, &blk)
  Maybe(value.send(method, *args, &blk))
end
nothing?() click to toggle source
# File lib/maybe/something.rb, line 18
def nothing?
  false
end
something?() click to toggle source
# File lib/maybe/something.rb, line 22
def something?
  true
end