Class: ScraperLeague

Inherits:
Object
  • Object
show all
Defined in:
lib/vegas_insider_scraper/scraper_league.rb

Defined Under Namespace

Modules: RegularExpressions Classes: Game

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScraperLeague

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_sportObject (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

#teamsObject (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_identifierObject (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_gamesObject

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_nameObject



9
10
11
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 9

def sport_name
  self.class.name.split('::').last.downcase
end

#standingsObject



21
22
23
# File 'lib/vegas_insider_scraper/scraper_league.rb', line 21

def standings
  @standings ||= scrape_standings
end

#team_schedulesObject

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