lib/baseball.rb in baseball-1.1.0 vs lib/baseball.rb in baseball-1.2.0
- old
+ new
@@ -6,14 +6,14 @@
require 'baseball/player'
module Baseball
#table of contents
- #batter stats
- #pitcher stats
- # fielder stats
- # runner stats
+ #batting stats
+ #pitching stats
+ # fielding stats
+ # running stats
def self.version_number
Baseball::VERSION
end
@@ -41,12 +41,18 @@
include Batting
player = Batter.new(player_hash)
player.ops
end
- #pitcher stats
+ def self.runs_created(player_hash)
+ include Batting
+ player = Batter.new(player_hash)
+ player.runs_created
+ end
+ #pitching stats
+
def self.era(pitcher_hash)
include Pitching
pitcher = Pitcher.new(pitcher_hash)
pitcher.era
end
@@ -61,18 +67,18 @@
include Pitching
pitcher = Pitcher.new(pitcher_hash)
pitcher.k_per_nine
end
- #fielder stats
+ #fielding stats
def self.fielding_percentage(fielder_hash)
include Fielding
fielder = Fielder.new(fielder_hash)
fielder.fielding_percentage
end
- # runner stats
+ # running stats
def self.stolen_base_percentage(runner_hash)
include Running
runner = Runner.new(runner_hash)
runner.stolen_base_percentage