Class: BikeReg::RegistrationResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/bike_reg/resources/registration_resource.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from BikeReg::Resource

Instance Method Details

#all(**params) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/bike_reg/resources/registration_resource.rb', line 5

def all(**params)
  reg_url = "https://www.bikereg.com/Registration/ConfirmedSingleRace.aspx?eid=&team=&RaceRecID=#{params[:category_id]}&EventID=#{params[:event_id]}"

  response = Scraper.parse!(:parse, url: reg_url)

  Collection.from_response(response, key: 'riders', type: Registration, start_page: params[:startpage])
end