class Just

Public Class Methods

new(obj) click to toggle source
# File lib/mayhaps.rb, line 22
def initialize(obj)
  if ::Maybe === obj || !obj.nil?
    @value = obj
  else
    ::Kernel.raise ::ArgumentError, 'object is nil'
  end
end

Public Instance Methods

+@() click to toggle source
# File lib/mayhaps.rb, line 30
def +@
  @value
end
inspect() click to toggle source
# File lib/mayhaps.rb, line 38
def inspect
  "#<Just #{@value.inspect}>"
end
method_missing(*args, &block) click to toggle source
# File lib/mayhaps.rb, line 34
def method_missing(*args, &block)
  @value.public_send(*args, &block).maybe
end