mlb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -2
- data/lib/mlb.rb +1 -1
- metadata +1 -1
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MLB.rb
|
2
2
|
|
3
|
-
**MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues
|
3
|
+
**MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.**
|
4
4
|
|
5
5
|
## Get it
|
6
6
|
|
@@ -35,7 +35,7 @@ At the command prompt, type:
|
|
35
35
|
=> "Shea Stadium"
|
36
36
|
>> team.logo_url
|
37
37
|
=> "http://img.freebase.com/api/trans/image_thumb/wikipedia/images/commons_id/3269938"
|
38
|
-
>> player = team.
|
38
|
+
>> player = team.players[14]; nil
|
39
39
|
=> nil
|
40
40
|
>> player.name
|
41
41
|
=> "David Wright"
|
data/lib/mlb.rb
CHANGED
@@ -67,7 +67,7 @@ class MLB
|
|
67
67
|
:league => result['league']['name'],
|
68
68
|
:division => result['division']['name'],
|
69
69
|
:manager => result['current_manager']['name'],
|
70
|
-
:
|
70
|
+
:players => result['current_roster'].map{|player| OpenStruct.new({:name => player['player'], :number => player['number'], :position => player['position'],})},
|
71
71
|
:wins => result['team_stats'].first['wins'].to_i,
|
72
72
|
:losses => result['team_stats'].first['losses'].to_i,
|
73
73
|
:founded => result['/sports/sports_team/founded'].first['value'].to_i,
|