class Object

Public Instance Methods

Maybe(value, parent_stack = [], inst_method = nil) click to toggle source

rubocop:disable MethodName

# File lib/possibly.rb, line 226
def Maybe(value, parent_stack = [], inst_method = nil)
  inst_method ||= ["Maybe", []]
  if value.nil? || (value.respond_to?(:length) && value.length == 0)
    None(inst_method, parent_stack)
  else
    Some(value, inst_method, parent_stack)
  end
end
None(inst_method = nil, parent_stack = []) click to toggle source
# File lib/possibly.rb, line 240
def None(inst_method = nil, parent_stack = [])
  inst_method ||= ["None", []]
  None.new(inst_method, parent_stack)
end
Some(value, inst_method = nil, parent_stack = []) click to toggle source
# File lib/possibly.rb, line 235
def Some(value, inst_method = nil, parent_stack = [])
  inst_method ||= ["Some", []]
  Some.new(value, inst_method, parent_stack)
end