Sha256: 65d71db3d3f819f3598c067838bcf3a14a96a6b803f353c4db79b5b3ea9a2efe

Contents?: true

Size: 676 Bytes

Versions: 16

Compression:

Stored size: 676 Bytes

Contents

# frozen_string_literal: true

module Faker
  class Coffee < Base
    flexible :coffee

    class << self
      def blend_name
        parse('coffee.blend_name')
      end

      def origin
        country = fetch('coffee.country')
        region = fetch("coffee.regions.#{search_format(country)}")
        "#{region}, #{country}"
      end

      def variety
        fetch('coffee.variety')
      end

      def notes
        parse('coffee.notes')
      end

      def intensifier
        fetch('coffee.intensifier')
      end

      private

      def search_format(key)
        key.split.length > 1 ? key.split.join('_').downcase : key.downcase
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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