Sha256: 0e237d25ba197534b1cc04d2a36a61cc0a7d0493f7219879c047c501584493f5

Contents?: true

Size: 262 Bytes

Versions: 9

Compression:

Stored size: 262 Bytes

Contents

# frozen_string_literal: true

module FFakerTW
  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

9 entries across 9 versions & 1 rubygems

Version Path
ffakerTW-1.8.0 lib/ffakerTW/boolean.rb
ffakerTW-1.7.0 lib/ffakerTW/boolean.rb
ffakerTW-1.6.0 lib/ffakerTW/boolean.rb
ffakerTW-1.5.0 lib/ffakerTW/boolean.rb
ffakerTW-1.4.0 lib/ffakerTW/boolean.rb
ffakerTW-1.3.0 lib/ffakerTW/boolean.rb
ffakerTW-1.2.0 lib/ffakerTW/boolean.rb
ffakerTW-1.1.0 lib/ffakerTW/boolean.rb
ffakerTW-0.1.0 lib/ffakerTW/boolean.rb