Class: SportsDataApi::Golf::Player
Instance Method Summary
collapse
Methods inherited from JsonData
#[], #initialize
Instance Method Details
#course ⇒ Object
4
5
6
|
# File 'lib/sports_data_api/golf/player.rb', line 4
def course
@course ||= Course.new(player[:course]) if player[:course]
end
|
#rounds ⇒ Object
14
15
16
17
18
|
# File 'lib/sports_data_api/golf/player.rb', line 14
def rounds
@rounds ||= player.fetch(:rounds, []).map do |json|
Round.new(json)
end
end
|
#scores ⇒ Object
8
9
10
11
12
|
# File 'lib/sports_data_api/golf/player.rb', line 8
def scores
@scores ||= player.fetch(:scores, []).map do |json|
Score.new(json)
end
end
|