Class: NpbApi::PitchingStats
- Inherits:
-
Object
- Object
- NpbApi::PitchingStats
- Defined in:
- lib/npb_api/pitching_stats.rb
Instance Method Summary collapse
- #away ⇒ Object
- #home ⇒ Object
-
#initialize(date: '', id: '') ⇒ PitchingStats
constructor
A new instance of PitchingStats.
Constructor Details
#initialize(date: '', id: '') ⇒ PitchingStats
Returns a new instance of PitchingStats.
2 3 4 5 6 7 |
# File 'lib/npb_api/pitching_stats.rb', line 2 def initialize(date: '', id: '') @date = date @game_id = (date.year.to_s + format('%02d', date.month) + format('%02d', date.day) + id).to_i @url = "http://baseball.yahoo.co.jp/npb/game/#{@game_id}/stats" @doc = TableExtraction.new(url: @url).doc end |
Instance Method Details
#away ⇒ Object
9 10 11 |
# File 'lib/npb_api/pitching_stats.rb', line 9 def away stats(:away) end |
#home ⇒ Object
13 14 15 |
# File 'lib/npb_api/pitching_stats.rb', line 13 def home stats(:home) end |