lib/garcon/core_ext/kernel.rb
# Random generator that returns true or false. Can also take a block that has
# a 50/50 chance to being executed.
#
Random generator that returns true or false. Can also take a block that has
a 50/50 chance to being executed.
Random generator that returns true or false . Can also take a block that has a 50 / 50 chance to being executed .
def maybe(chance = 0.5, &block)
    if block
      yield if rand < chance
    else
      rand < chance
    end
  end
def maybe ( chance = 0.5 , & block ) if block yield if rand < chance else rand < chance end end
Random generator that returns true or false.
Random generator that returns true or false .
chance
<not_specific>
block
<not_specific>