Class: Faker::Sports::Basketball

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/sports/basketball.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, translate, unique, with_locale

Class Method Details

.coachString

Produces the name of a basketball coach.

Examples:

Faker::Sports::Basketball.coach #=> "Gregg Popovich"

Returns:

  • (String)

Available since:

  • 1.9.4



42
43
44
# File 'lib/faker/sports/basketball.rb', line 42

def coach
  fetch('basketball.coaches')
end

.playerString

Produces the name of a basketball player.

Examples:

Faker::Sports::Basketball.player #=> "LeBron James"

Returns:

  • (String)

Available since:

  • 1.9.4



29
30
31
# File 'lib/faker/sports/basketball.rb', line 29

def player
  fetch('basketball.players')
end

.positionString

Produces a position in basketball.

Examples:

Faker::Sports::Basketball.position #=> "Point Guard"

Returns:

  • (String)

Available since:

  • 1.9.4



55
56
57
# File 'lib/faker/sports/basketball.rb', line 55

def position
  fetch('basketball.positions')
end

.teamString

Produces the name of a basketball team.

Examples:

Faker::Sports::Basketball.team #=> "Golden State Warriors"

Returns:

  • (String)

Available since:

  • 1.9.4



16
17
18
# File 'lib/faker/sports/basketball.rb', line 16

def team
  fetch('basketball.teams')
end