Module: BostonMarathon

Defined in:
lib/boston_marathon.rb,
lib/boston_marathon/result.rb,
lib/boston_marathon/version.rb,
lib/boston_marathon/result_set.rb,
lib/boston_marathon/record_not_found.rb

Defined Under Namespace

Classes: RecordNotFound, Result, ResultSet

Constant Summary collapse

BASE_URL =
"http://registration.baa.org/2011/cf/Public/iframe_ResultsSearch.cfm?mode=results"
RESULTS_PER_PAGE =

up to 25 results can be retrieved at a time

25
RACE_CAP =

an arbitrary number that’s larger than the number of race participants

30000
VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.result(bib) ⇒ Object

returns the result for a specific bib number



19
20
21
22
23
# File 'lib/boston_marathon.rb', line 19

def result(bib)
  result_set = fetch({'BibNumber' => bib})
  raise BostonMarathon::RecordNotFound if result_set.empty?
  result_set[0]
end

.results(params) ⇒ Object

returns a max of RESULTS_PER_PAGE results. see README for list of query params



27
28
29
# File 'lib/boston_marathon.rb', line 27

def results(params)
  fetch({'VarTargetCount' => RACE_CAP}.merge params)
end