Class: Faker::Coffee

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/coffee.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, shuffle!, translate, unique, with_locale

Class Method Details

.blend_nameString

Produces a random blend name.

Examples:

Faker::Coffee.blend_name #=> "Major Java"

Returns:

  • (String)

Available since:

  • 1.9.0



17
18
19
# File 'lib/faker/default/coffee.rb', line 17

def blend_name
  parse('coffee.blend_name')
end

.intensifierString

Produces a random coffee taste intensity.

Examples:

Faker::Coffee.intensifier #=> "mild"

Returns:

  • (String)

Available since:

  • 1.9.0



71
72
73
# File 'lib/faker/default/coffee.rb', line 71

def intensifier
  fetch('coffee.intensifier')
end

.notesString

Produces a string containing a random description of a coffee’s taste.

Examples:

Faker::Coffee.notes #=> "dull, tea-like, cantaloupe, soy sauce, marshmallow"

Returns:

  • (String)

Available since:

  • 1.9.0



58
59
60
# File 'lib/faker/default/coffee.rb', line 58

def notes
  parse('coffee.notes')
end

.originString

Produces a random coffee origin place.

Examples:

Faker::Coffee.origin #=> "Oaxaca, Mexico"

Returns:

  • (String)

Available since:

  • 1.9.0



30
31
32
33
34
# File 'lib/faker/default/coffee.rb', line 30

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

.varietyString

Produces a random coffee variety.

Examples:

Faker::Coffee.variety #=> "Red Bourbon"

Returns:

  • (String)

Available since:

  • 1.9.0



45
46
47
# File 'lib/faker/default/coffee.rb', line 45

def variety
  fetch('coffee.variety')
end