module NoConditionals::Truthiness

Mixin for truthy behavior

Public Instance Methods

hence() { |self| ... } click to toggle source

evaluates a block, passes object

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

just returns first parameter (so), ignores optional second parameter (maybe)

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

calls first parameter (so)

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

just returns object, ignores block

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