Class: ScoreScraper::Scoreboard

Inherits:
Object
  • Object
show all
Defined in:
lib/score_scraper/scoreboard.rb

Instance Method Summary collapse

Constructor Details

#initialize(search_date = nil, teams = []) ⇒ Scoreboard

Returns a new instance of Scoreboard.



4
5
6
7
# File 'lib/score_scraper/scoreboard.rb', line 4

def initialize(search_date = nil, teams = [])
  @teams = teams
  @search_date = search_date || Time.now.strftime("%Y-%m-%d") 
end

Instance Method Details

#games(game_separator = '|') ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/score_scraper/scoreboard.rb', line 9

def games(game_separator = '|')
  game_array = []

  team_games.each do |game|
    game_array << single_game(game)
  end

  game_array.join(game_separator)
end