class Faker::Tea

Public Class Methods

type() click to toggle source

Produces a random type of tea.

@return [String] a type of tea

@example

Faker::Tea.type
  #=> "Green"

@faker.version next

# File lib/faker/default/tea.rb, line 36
def type
  fetch 'tea.type'
end
variety(type: nil) click to toggle source

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

# File lib/faker/default/tea.rb, line 22
def variety(type: nil)
  type ||= fetch('tea.type')
  fetch "tea.variety.#{type.downcase}"
end