Class: AhlScraper::Scoreboard

Inherits:
Resource
  • Object
show all
Defined in:
lib/ahl_scraper/resources/scoreboard.rb

Instance Method Summary collapse

Methods inherited from Resource

#[], #each, #inspect, #keys, #to_json, #values

Constructor Details

#initialize(raw_data) ⇒ Scoreboard

Returns a new instance of Scoreboard.



5
6
7
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 5

def initialize(raw_data)
  super(raw_data, {})
end

Instance Method Details

#away_scoreObject



97
98
99
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 97

def away_score
  @away_score ||= @raw_data[:VisitorGoals].to_i
end

#away_teamObject



101
102
103
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 101

def away_team
  @away_team ||= Scoreboards::Team.new(away_team_data)
end

#game_clockObject



61
62
63
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 61

def game_clock
  @game_clock ||= @raw_data[:GameClock]
end

#game_dateObject



21
22
23
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 21

def game_date
  @game_date ||= @raw_data[:Date]
end

#game_date_ISO8601Object



33
34
35
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 33

def game_date_ISO8601
  @game_date_ISO8601 ||= @raw_data[:GameDateISO8601]
end

#game_date_wordsObject



29
30
31
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 29

def game_date_words
  @game_date_words ||= @raw_data[:GameDate]
end

#game_numberObject



17
18
19
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 17

def game_number
  @game_number ||= @raw_data[:game_number].to_i
end

#game_statusObject



69
70
71
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 69

def game_status
  @game_status ||= @raw_data[:GameStatusString]
end

#game_status_string_longObject



73
74
75
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 73

def game_status_string_long
  @game_status_string_long ||= @raw_data[:GameStatusStringLong]
end

#home_scoreObject



89
90
91
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 89

def home_score
  @home_score ||= @raw_data[:HomeGoals].to_i
end

#home_teamObject



93
94
95
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 93

def home_team
  @home_team ||= Scoreboards::Team.new(home_team_data)
end

#htv_game_idObject



25
26
27
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 25

def htv_game_id
  @htv_game_id ||= @raw_data[:HtvGameID].to_i
end

#idObject



9
10
11
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 9

def id
  @id ||= @raw_data[:ID].to_i
end

#intermission?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 65

def intermission?
  @intermission ||= @raw_data[:Intermission] == "1"
end

#periodObject



53
54
55
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 53

def period
  @period ||= @raw_data[:Period].to_i
end

#period_long_nameObject



57
58
59
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 57

def period_long_name
  @period_long_name ||= @raw_data[:PeriodNameLong]
end

#scheduled_timeObject



37
38
39
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 37

def scheduled_time
  @scheduled_time ||= @raw_data[:ScheduledTime]
end

#scheduled_time_formattedObject



41
42
43
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 41

def scheduled_time_formatted
  @scheduled_time_formatted ||= @raw_data[:ScheduledFormattedTime]
end

#season_idObject



13
14
15
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 13

def season_id
  @season_id ||= @raw_data[:SeasonID].to_i
end

#ticket_urlObject



49
50
51
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 49

def ticket_url
  @ticket_url ||= @raw_data[:TicketUrl]
end

#timezoneObject



45
46
47
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 45

def timezone
  @timezone ||= @raw_data[:Timezone]
end

#timezone_shortObject



85
86
87
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 85

def timezone_short
  @timezone_short ||= @raw_data[:TimezoneShort]
end

#venue_locationObject



81
82
83
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 81

def venue_location
  @venue_location ||= @raw_data[:venue_location]
end

#venue_nameObject



77
78
79
# File 'lib/ahl_scraper/resources/scoreboard.rb', line 77

def venue_name
  @venue_name ||= @raw_data[:venue_name]
end