Sha256: 6f544ac19d27d90e593f1904fb0d0e15df3cdacfd6648a7da3d599f595eac86f

Contents?: true

Size: 265 Bytes

Versions: 3

Compression:

Stored size: 265 Bytes

Contents

# encoding: utf-8

module FFaker
  module Boolean
    extend ModuleUtils
    extend self

    def maybe
      case rand(2)
      when 0 then true
      when 1 then false
      end
    end

    alias_method :random, :maybe
    alias_method :sample, :maybe
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ffaker-2.2.0 lib/ffaker/boolean.rb
ffaker-2.1.0 lib/ffaker/boolean.rb
ffaker-2.0.0 lib/ffaker/boolean.rb