Class: SportsDataApi::Golf::Player

Inherits:
JsonData
  • Object
show all
Defined in:
lib/sports_data_api/golf/player.rb

Instance Method Summary collapse

Methods inherited from JsonData

#[], #initialize

Constructor Details

This class inherits a constructor from SportsDataApi::JsonData

Instance Method Details

#courseObject



4
5
6
# File 'lib/sports_data_api/golf/player.rb', line 4

def course
  @course ||= Course.new(player[:course]) if player[:course]
end

#roundsObject



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

#scoresObject



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