lib/baseball.rb in baseball-0.4.0 vs lib/baseball.rb in baseball-1.0.0
- old
+ new
@@ -9,10 +9,11 @@
#table of contents
#batter stats
#pitcher stats
# fielder stats
+ # runner stats
def self.version_number
Baseball::VERSION
end
@@ -41,10 +42,11 @@
player = Batter.new(player_hash)
player.ops
end
#pitcher stats
+
def self.era(pitcher_hash)
include Pitching
pitcher = Pitcher.new(pitcher_hash)
pitcher.era
end
@@ -53,19 +55,34 @@
include Pitching
pitcher = Pitcher.new(pitcher_hash)
pitcher.whip
end
+ def self.k_per_nine(pitcher_hash)
+ include Pitching
+ pitcher = Pitcher.new(pitcher_hash)
+ pitcher.k_per_nine
+ end
+
#fielder stats
+
def self.fielding_percentage(fielder_hash)
include Fielding
fielder = Fielder.new(fielder_hash)
fielder.fielding_percentage
end
+ # runner stats
+
def self.stolen_base_percentage(runner_hash)
include Running
runner = Runner.new(runner_hash)
runner.stolen_base_percentage
+ end
+
+ def self.stolen_base_runs(runner_hash)
+ include Running
+ runner = Runner.new(runner_hash)
+ runner.stolen_base_runs
end
end