Sha256: f650a2a8e4f6f54a070772ba8d47185b5f2d05c613d3b291f73841bcd720bccd
Contents?: true
Size: 929 Bytes
Versions: 19
Compression:
Stored size: 929 Bytes
Contents
# frozen_string_literal: true module Faker class Tea < Base flexible :tea class << self ## # Produces a random variety or blend of tea. # # @param type [String, nil] the type of tea to query for (valid types: 'Black', 'Green', 'Oolong', 'White', and 'Herbal') # @return [String] a variety of tea # # @example # Faker::Tea.variety # #=> "Earl Grey" # # @example # Faker::Tea.variety(type: 'Green') # #=> "Jasmine" # @faker.version next def variety(type: nil) type ||= fetch('tea.type') fetch "tea.variety.#{type.downcase}" end ## # Produces a random type of tea. # # @return [String] a type of tea # # @example # Faker::Tea.type # #=> "Green" # @faker.version next def type fetch 'tea.type' end end end end
Version data entries
19 entries across 19 versions & 2 rubygems