Sha256: bec8fb129dfd550ef8943b2b2f5a2d372b1a8111f9f86bfaadd861b127049fd1

Contents?: true

Size: 260 Bytes

Versions: 12

Compression:

Stored size: 260 Bytes

Contents

# frozen_string_literal: true

module FFaker
  module Boolean
    extend ModuleUtils
    extend self

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

    alias random maybe
    alias sample maybe
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ffaker-2.23.0 lib/ffaker/boolean.rb
ffaker-2.22.0 lib/ffaker/boolean.rb
ffaker-2.21.0 lib/ffaker/boolean.rb
ffaker-2.20.0 lib/ffaker/boolean.rb
ffaker-2.19.0 lib/ffaker/boolean.rb
ffaker-2.18.0 lib/ffaker/boolean.rb
ffaker-2.17.0 lib/ffaker/boolean.rb
ffaker-2.16.0 lib/ffaker/boolean.rb
ffaker-2.15.0 lib/ffaker/boolean.rb
ffaker-2.14.0 lib/ffaker/boolean.rb
ffaker-2.13.0 lib/ffaker/boolean.rb
ffaker-2.12.0 lib/ffaker/boolean.rb