Module: Random::Object

Module | Random::Object
In: | lib/more/facets/random.rb

### Methods

maybe

### Public Instance methods

maybe(chance = 0.5) {|if rand < chance| ...}

Random generator that returns true or false. Can also take a block that has a 50/50 chance to being executed.

      maybe  #=> true
      maybe  #=> false

[Source]

    # File lib/more/facets/random.rb, line 88
        def maybe(chance = 0.5, &block)
          if block then
            yield if rand < chance
          else
            rand < chance
          end
        end

[Validate]