module NoConditionals::Falseyness

Mixin for falsey behavior

Public Instance Methods

hence() click to toggle source

just returns object, ignores block

# File lib/no_conditionals.rb, line 34
def hence
  self
end
maybe(so, maybe: self) click to toggle source

ignores first parameter (so), returns either object or keyword argument (maybe)

# File lib/no_conditionals.rb, line 44
def maybe so, maybe: self
  maybe
end
maybe!(so, maybe: -> { self) click to toggle source

calls keyword argument (maybe) or nothing

# File lib/no_conditionals.rb, line 49
def maybe! so, maybe: -> { self }
  maybe.call
end
otherwise() { |self| ... } click to toggle source

evaluates a block

# File lib/no_conditionals.rb, line 39
def otherwise
  yield self
end