Class: ScraperLeague
- Inherits:
-
Object
- Object
- ScraperLeague
- Defined in:
- lib/vegas_insider_scraper/scraper_league.rb
Direct Known Subclasses
VegasInsiderScraper::MLB, VegasInsiderScraper::NBA, VegasInsiderScraper::NCAABB, VegasInsiderScraper::NCAAFB, VegasInsiderScraper::NFL, VegasInsiderScraper::NHL, VegasInsiderScraper::Soccer
Defined Under Namespace
Modules: RegularExpressions Classes: Game
Instance Attribute Summary collapse
-
#moneyline_sport ⇒ Object
readonly
Returns the value of attribute moneyline_sport.
-
#teams ⇒ Object
readonly
Returns the value of attribute teams.
-
#vegas_sport_identifier ⇒ Object
readonly
Returns the value of attribute vegas_sport_identifier.
Instance Method Summary collapse
-
#current_games ⇒ Object
Gets the upcoming/current games for the sport.
-
#initialize ⇒ ScraperLeague
constructor
A new instance of ScraperLeague.
- #schedule_for(identifier) ⇒ Object
- #sport_name ⇒ Object
- #standings ⇒ Object
-
#team_schedules ⇒ Object
Gets all of the schedule and results for each team.
Constructor Details
#initialize ⇒ ScraperLeague
Returns a new instance of ScraperLeague.
13 14 15 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 13 def initialize @moneyline_sport = false end |
Instance Attribute Details
#moneyline_sport ⇒ Object (readonly)
Returns the value of attribute moneyline_sport.
6 7 8 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 6 def moneyline_sport @moneyline_sport end |
#teams ⇒ Object (readonly)
Returns the value of attribute teams.
7 8 9 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 7 def teams @teams end |
#vegas_sport_identifier ⇒ Object (readonly)
Returns the value of attribute vegas_sport_identifier.
5 6 7 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 5 def vegas_sport_identifier @vegas_sport_identifier end |
Instance Method Details
#current_games ⇒ Object
Gets the upcoming/current games for the sport
26 27 28 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 26 def current_games @current_games ||= get_lines(["http://www.vegasinsider.com/#{vegas_sport_identifier}/odds/las-vegas/","http://www.vegasinsider.com/#{vegas_sport_identifier}/odds/las-vegas/money/"]) end |
#schedule_for(identifier) ⇒ Object
38 39 40 41 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 38 def schedule_for(identifier) url = "http://www.vegasinsider.com/#{vegas_sport_identifier}/teams/team-page.cfm/team/#{identifier}" scrape_team_page(url, identifier) end |
#sport_name ⇒ Object
9 10 11 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 9 def sport_name self.class.name.split('::').last.downcase end |
#standings ⇒ Object
21 22 23 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 21 def standings @standings ||= scrape_standings end |
#team_schedules ⇒ Object
Gets all of the schedule and results for each team
31 32 33 34 35 36 |
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 31 def team_schedules @team_schedules ||= teams.map do |team| puts " >>>>>> GETTING GAMES FOR: #{team[:info][:full_name]}" team_schedule_for(team[:info][:identifier]) end end |