Sha256: e9702a3955e9cb2f596ab6c86e50977256f086afeca5c114ce2d85a24a2a812f

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

require 'baseball/player'

module Running

  class Runner < Player::PlayerTemplate

    def stolen_base_percentage
      player_stolen_base_percentage = @player[:stolen_bases].to_f / (@player[:stolen_bases ].to_f + @player[:caught_stealing].to_f)
      stealing_average = player_stolen_base_percentage.round(3)
      average_string = stealing_average.to_s.sub!("0", "")
      figure_trailing_zeroes(average_string)
    end

    def stolen_base_runs
      #Created by Total baseball
      # (.3 x stolen bases) - (.6 x caught stealing)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
baseball-0.4.0 lib/baseball/running.rb