Sha256: 91117be524391f5d625dc8600deff599c9a711c76ad3746c2d1fb4e4910385cd

Contents?: true

Size: 594 Bytes

Versions: 20

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

module Faker
  class Beer < Base
    flexible :beer

    class << self
      def name
        fetch('beer.name')
      end

      def style
        fetch('beer.style')
      end

      def hop
        fetch('beer.hop')
      end

      def yeast
        fetch('beer.yeast')
      end

      def malts
        fetch('beer.malt')
      end

      def ibu
        rand(10..100).to_s + ' IBU'
      end

      def alcohol
        rand(2.0..10.0).round(1).to_s + '%'
      end

      def blg
        rand(5.0..20.0).round(1).to_s + '°Blg'
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
faker-2.8.1 lib/faker/default/beer.rb
faker-2.8.0 lib/faker/default/beer.rb
faker-2.7.0 lib/faker/default/beer.rb
faker-2.6.0 lib/faker/default/beer.rb
faker-2.5.0 lib/faker/default/beer.rb
faker-2.4.0 lib/faker/default/beer.rb
faker-2.3.0 lib/faker/default/beer.rb
faker-2.2.2 lib/faker/default/beer.rb
faker-2.2.1 lib/faker/default/beer.rb
faker-2.2.0 lib/faker/default/beer.rb
faker-2.1.2 lib/faker/default/beer.rb
faker-2.1.1 lib/faker/default/beer.rb
faker-2.1.0 lib/faker/default/beer.rb
faker-2.0.0 lib/faker/default/beer.rb
faker-2.0 lib/faker/default/beer.rb
faker-1.9.6 lib/faker/default/beer.rb
faker-1.9.5 lib/faker/default/beer.rb
faker-1.9.4 lib/faker/default/beer.rb
faker-1.9.3 lib/faker/default/beer.rb
faker-1.9.2 lib/faker/default/beer.rb