Class: NpbApi::Stats::Hitting
- Inherits:
-
Base
- Object
- Base
- NpbApi::Stats::Hitting
show all
- Defined in:
- lib/npb-api/stats/hitting.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/hitting.rb', line 4
def self.url_key
'b'
end
|
Instance Method Details
#at_bats ⇒ Object
20
21
22
|
# File 'lib/npb-api/stats/hitting.rb', line 20
def at_bats
@row.children[6].text.to_i
end
|
#bases_on_balls ⇒ Object
68
69
70
|
# File 'lib/npb-api/stats/hitting.rb', line 68
def bases_on_balls
@row.children[19].text.to_i
end
|
#batting_average ⇒ Object
88
89
90
|
# File 'lib/npb-api/stats/hitting.rb', line 88
def batting_average
@row.children[25].text.to_f
end
|
#caught_stealing ⇒ Object
56
57
58
|
# File 'lib/npb-api/stats/hitting.rb', line 56
def caught_stealing
@row.children[16].text.to_i
end
|
#double ⇒ Object
32
33
34
|
# File 'lib/npb-api/stats/hitting.rb', line 32
def double
@row.children[9].text.to_i
end
|
#games ⇒ Object
12
13
14
|
# File 'lib/npb-api/stats/hitting.rb', line 12
def games
@row.children[4].text.to_i
end
|
#grounded_into_double_play ⇒ Object
84
85
86
|
# File 'lib/npb-api/stats/hitting.rb', line 84
def grounded_into_double_play
@row.children[24].text.to_i
end
|
#hit_by_pitch ⇒ Object
76
77
78
|
# File 'lib/npb-api/stats/hitting.rb', line 76
def hit_by_pitch
@row.children[22].text.to_i
end
|
#hits ⇒ Object
28
29
30
|
# File 'lib/npb-api/stats/hitting.rb', line 28
def hits
@row.children[8].text.to_i
end
|
#home_runs ⇒ Object
40
41
42
|
# File 'lib/npb-api/stats/hitting.rb', line 40
def home_runs
@row.children[11].text.to_i
end
|
#intentional_bases_on_balls ⇒ Object
72
73
74
|
# File 'lib/npb-api/stats/hitting.rb', line 72
def intentional_bases_on_balls
@row.children[21].text.to_i
end
|
#on_base_percentage ⇒ Object
96
97
98
|
# File 'lib/npb-api/stats/hitting.rb', line 96
def on_base_percentage
@row.children[27].text.to_f
end
|
#on_base_plus_slugging ⇒ Object
100
101
102
|
# File 'lib/npb-api/stats/hitting.rb', line 100
def on_base_plus_slugging
slugging_percentage + on_base_percentage
end
|
#player ⇒ Object
8
9
10
|
# File 'lib/npb-api/stats/hitting.rb', line 8
def player
@row.children[2].children.text
end
|
#runs ⇒ Object
24
25
26
|
# File 'lib/npb-api/stats/hitting.rb', line 24
def runs
@row.children[7].text.to_i
end
|
#runs_batted_in ⇒ Object
48
49
50
|
# File 'lib/npb-api/stats/hitting.rb', line 48
def runs_batted_in
@row.children[14].text.to_i
end
|
#sacrifice_flies ⇒ Object
64
65
66
|
# File 'lib/npb-api/stats/hitting.rb', line 64
def sacrifice_flies
@row.children[18].text.to_i
end
|
#sacrifice_hits ⇒ Object
60
61
62
|
# File 'lib/npb-api/stats/hitting.rb', line 60
def sacrifice_hits
@row.children[17].text.to_i
end
|
#slugging_percentage ⇒ Object
92
93
94
|
# File 'lib/npb-api/stats/hitting.rb', line 92
def slugging_percentage
@row.children[26].text.to_f
end
|
#stolen_bases ⇒ Object
52
53
54
|
# File 'lib/npb-api/stats/hitting.rb', line 52
def stolen_bases
@row.children[15].text.to_i
end
|
#strikeouts ⇒ Object
80
81
82
|
# File 'lib/npb-api/stats/hitting.rb', line 80
def strikeouts
@row.children[23].text.to_i
end
|
#total_bases ⇒ Object
44
45
46
|
# File 'lib/npb-api/stats/hitting.rb', line 44
def total_bases
@row.children[13].text.to_i
end
|
#total_plate_appearances ⇒ Object
16
17
18
|
# File 'lib/npb-api/stats/hitting.rb', line 16
def total_plate_appearances
@row.children[5].text.to_i
end
|
#triple ⇒ Object
36
37
38
|
# File 'lib/npb-api/stats/hitting.rb', line 36
def triple
@row.children[10].text.to_i
end
|