MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.
gem install mlb
$ irb >> require 'mlb' >> MLB::Team.all.first.name # => "Arizona Diamondbacks" >> MLB::Team.all.first.league # => "National League" >> MLB::Team.all.first.division # => "National League West" >> MLB::Team.all.first.manager # => "Bob Melvin" >> MLB::Team.all.first.wins # => 82 >> MLB::Team.all.first.losses # => 80 >> MLB::Team.all.first.founded # => 1998 >> MLB::Team.all.first.mascot # => nil >> MLB::Team.all.first.ballpark # => "Chase Field" >> MLB::Team.all.first.logo_url # => "http://img.freebase.com/api/trans/image_thumb/wikipedia/images/en_id/13104064" >> MLB::Team.all.first.players.first.name # => "Alex Romero" >> MLB::Team.all.first.players.first.number # => 28 >> MLB::Team.all.first.players.first.position # => "Right fielder"
This library aims to support and is tested against the following Ruby implementations:
If something doesn't work on one of these interpreters, it's a bug.
This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the versions listed above.
If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.
MLB was built with the following tools:
Copyright (c) 2010-2013 Erik Michaels-Ober. See LICENSE for details.