Class: CbsFantasySportsApiTokenFetcher
- Inherits:
-
Object
- Object
- CbsFantasySportsApiTokenFetcher
- Defined in:
- lib/cbs_fantasy_sports_api_token_fetcher.rb
Constant Summary collapse
- TOKEN_REGEX =
/(?<=var token = ").+(?=")/
- URL =
"https://www.cbssports.com/login".freeze
- VERSION =
"0.1.0"
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(league_name:, password:, user_id:) ⇒ CbsFantasySportsApiTokenFetcher
constructor
A new instance of CbsFantasySportsApiTokenFetcher.
Constructor Details
#initialize(league_name:, password:, user_id:) ⇒ CbsFantasySportsApiTokenFetcher
Returns a new instance of CbsFantasySportsApiTokenFetcher.
8 9 10 11 12 |
# File 'lib/cbs_fantasy_sports_api_token_fetcher.rb', line 8 def initialize(league_name:, password:, user_id:) @league_name = league_name @password = password @user_id = user_id end |
Instance Method Details
#fetch ⇒ Object
14 15 16 |
# File 'lib/cbs_fantasy_sports_api_token_fetcher.rb', line 14 def fetch page.match(TOKEN_REGEX).to_s end |