Module: TsJsonApi::Requestor::Points::ClassMethods

Defined in:
lib/ts_json_api/requestor/points.rb

Instance Method Summary collapse

Instance Method Details

#points_per_race(race_season, series_id, race_id = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ts_json_api/requestor/points.rb', line 8

def points_per_race(race_season, series_id, race_id=nil)

	url = "driverpoints?race_season=#{race_season}&series_id=#{series_id}"
	path = "#{race_season}/#{series_id}/points"

	unless race_id.blank?
		url << "&race_id=#{race_id}"
		path.gsub! "points.log", "#{race_id}-points"
	end

	send_json_request_and_deliver_response path, url

end