lorem_athlete 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/athletes.yml +4510 -101
  2. data/lib/lorem_athlete.rb +13 -1
  3. metadata +1 -1
data/lib/lorem_athlete.rb CHANGED
@@ -8,8 +8,20 @@ class LoremAthlete
8
8
  sports[rand(sports.length)]
9
9
  end
10
10
 
11
- def self.athlete
11
+ def self.athlete(sport='default')
12
12
  athletes = YAML::load( File.open('lib/athletes.yml'))
13
+ case sport.downcase
14
+ when "nfl"
15
+ athletes = athletes["nfl"]
16
+ when "nhl"
17
+ athletes = athletes["nhl"]
18
+ when "nba"
19
+ athletes = athletes["nba"]
20
+ when "mlb"
21
+ athletes = athletes["mlb"]
22
+ else
23
+ athletes = athletes.map{|k, v| v}.flatten
24
+ end
13
25
  athletes[rand(athletes.length)]
14
26
  end
15
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorem_athlete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: