Class: NpbApi::Stats::Pitching
- Inherits:
-
Base
- Object
- Base
- NpbApi::Stats::Pitching
show all
- Defined in:
- lib/npb-api/stats/pitching.rb
Constant Summary
Constants inherited
from Base
Base::LEAGUES, Base::TEAMS, Base::TEAM_LEAGUES
Instance Attribute Summary
Attributes inherited from Base
#league, #team, #year
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
all, #initialize, list
Class Method Details
.url_key ⇒ Object
4
5
6
|
# File 'lib/npb-api/stats/pitching.rb', line 4
def self.url_key
'p'
end
|
Instance Method Details
#balks ⇒ Object
103
104
105
106
|
# File 'lib/npb-api/stats/pitching.rb', line 103
def balks
line = (farm? ? 24 : 26)
@row.children[line].text.to_i
end
|
#complete_games ⇒ Object
38
39
40
41
|
# File 'lib/npb-api/stats/pitching.rb', line 38
def complete_games
line = (farm? ? 8 : 10)
@row.children[line].text.to_i
end
|
#earned_run_average ⇒ Object
118
119
120
121
|
# File 'lib/npb-api/stats/pitching.rb', line 118
def earned_run_average
line = (farm? ? 27 : 29)
@row.children[line].text.to_f
end
|
#earned_runs ⇒ Object
113
114
115
116
|
# File 'lib/npb-api/stats/pitching.rb', line 113
def earned_runs
line = (farm? ? 26 : 28)
@row.children[line].text.to_i
end
|
#games ⇒ Object
12
13
14
|
# File 'lib/npb-api/stats/pitching.rb', line 12
def games
@row.children[4].text.to_i
end
|
#hit_by_pitch ⇒ Object
88
89
90
91
|
# File 'lib/npb-api/stats/pitching.rb', line 88
def hit_by_pitch
line = (farm? ? 21 : 23)
@row.children[line].text.to_i
end
|
#hits ⇒ Object
68
69
70
71
|
# File 'lib/npb-api/stats/pitching.rb', line 68
def hits
line = (farm? ? 16 : 18)
@row.children[line].text.to_i
end
|
#hold_points ⇒ Object
33
34
35
36
|
# File 'lib/npb-api/stats/pitching.rb', line 33
def hold_points
return nil if farm?
@row.children[9].text.to_i
end
|
#holds ⇒ Object
28
29
30
31
|
# File 'lib/npb-api/stats/pitching.rb', line 28
def holds
return nil if farm?
@row.children[8].text.to_i
end
|
#home_runs ⇒ Object
73
74
75
76
|
# File 'lib/npb-api/stats/pitching.rb', line 73
def home_runs
line = (farm? ? 18 : 20)
@row.children[line].text.to_i
end
|
#innings_pitched ⇒ Object
63
64
65
66
|
# File 'lib/npb-api/stats/pitching.rb', line 63
def innings_pitched
line1, line2 = (farm? ? [14, 15] : [16, 17])
(@row.children[line1].text + @row.children[line2].text).to_f
end
|
#intentional_walks ⇒ Object
83
84
85
86
|
# File 'lib/npb-api/stats/pitching.rb', line 83
def intentional_walks
line = (farm? ? 20 : 22)
@row.children[line].text.to_i
end
|
#loses ⇒ Object
20
21
22
|
# File 'lib/npb-api/stats/pitching.rb', line 20
def loses
@row.children[6].text.to_i
end
|
#player ⇒ Object
8
9
10
|
# File 'lib/npb-api/stats/pitching.rb', line 8
def player
@row.children[2].text
end
|
#runs ⇒ Object
108
109
110
111
|
# File 'lib/npb-api/stats/pitching.rb', line 108
def runs
line = (farm? ? 25 : 27)
@row.children[line].text.to_i
end
|
#saves ⇒ Object
24
25
26
|
# File 'lib/npb-api/stats/pitching.rb', line 24
def saves
@row.children[7].text.to_i
end
|
#shutouts ⇒ Object
43
44
45
46
|
# File 'lib/npb-api/stats/pitching.rb', line 43
def shutouts
line = (farm? ? 9 : 11)
@row.children[line].text.to_i
end
|
#strikeouts ⇒ Object
93
94
95
96
|
# File 'lib/npb-api/stats/pitching.rb', line 93
def strikeouts
line = (farm? ? 22 : 24)
@row.children[line].text.to_i
end
|
#total_batters_faced ⇒ Object
58
59
60
61
|
# File 'lib/npb-api/stats/pitching.rb', line 58
def total_batters_faced
line = (farm? ? 13 : 15)
@row.children[line].text.to_i
end
|
#walks ⇒ Object
78
79
80
81
|
# File 'lib/npb-api/stats/pitching.rb', line 78
def walks
line = (farm? ? 19 : 21)
@row.children[line].text.to_i
end
|
#wild_pitches ⇒ Object
98
99
100
101
|
# File 'lib/npb-api/stats/pitching.rb', line 98
def wild_pitches
line = (farm? ? 23 : 25)
@row.children[line].text.to_i
end
|
#winning_percentage ⇒ Object
53
54
55
56
|
# File 'lib/npb-api/stats/pitching.rb', line 53
def winning_percentage
line = (farm? ? 12 : 14)
@row.children[line].text.to_f
end
|
#wins ⇒ Object
16
17
18
|
# File 'lib/npb-api/stats/pitching.rb', line 16
def wins
@row.children[5].text.to_i
end
|
#without_walking ⇒ Object
48
49
50
51
|
# File 'lib/npb-api/stats/pitching.rb', line 48
def without_walking
line = (farm? ? 10 : 12)
@row.children[line].text.to_i
end
|