Class: NBA::VideoStatusEntry

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/nba/video_status_entry.rb

Overview

Represents a video status entry

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#game_dateString

Returns the game date

Examples:

entry.game_date #=> "2023-10-24"

Returns:

  • (String)

    the game date



23
# File 'lib/nba/video_status_entry.rb', line 23

attribute :game_date, Shale::Type::String

#game_idString

Returns the game ID

Examples:

entry.game_id #=> "0022300001"

Returns:

  • (String)

    the game ID



15
# File 'lib/nba/video_status_entry.rb', line 15

attribute :game_id, Shale::Type::String

#game_statusInteger

Returns the game status code

Examples:

entry.game_status #=> 3

Returns:

  • (Integer)

    the game status code



95
# File 'lib/nba/video_status_entry.rb', line 95

attribute :game_status, Shale::Type::Integer

#game_status_textString

Returns the game status text

Examples:

entry.game_status_text #=> "Final"

Returns:

  • (String)

    the game status text



103
# File 'lib/nba/video_status_entry.rb', line 103

attribute :game_status_text, Shale::Type::String

#home_team_abbreviationString

Returns the home team abbreviation

Examples:

entry.home_team_abbreviation #=> "LAL"

Returns:

  • (String)

    the home team abbreviation



87
# File 'lib/nba/video_status_entry.rb', line 87

attribute :home_team_abbreviation, Shale::Type::String

#home_team_cityString

Returns the home team city

Examples:

entry.home_team_city #=> "Los Angeles"

Returns:

  • (String)

    the home team city



71
# File 'lib/nba/video_status_entry.rb', line 71

attribute :home_team_city, Shale::Type::String

#home_team_idInteger

Returns the home team ID

Examples:

entry.home_team_id #=> 1610612747

Returns:

  • (Integer)

    the home team ID



63
# File 'lib/nba/video_status_entry.rb', line 63

attribute :home_team_id, Shale::Type::Integer

#home_team_nameString

Returns the home team name

Examples:

entry.home_team_name #=> "Lakers"

Returns:

  • (String)

    the home team name



79
# File 'lib/nba/video_status_entry.rb', line 79

attribute :home_team_name, Shale::Type::String

#is_availableInteger

Returns the video availability flag

Examples:

entry.is_available #=> 1

Returns:

  • (Integer)

    the video availability flag



111
# File 'lib/nba/video_status_entry.rb', line 111

attribute :is_available, Shale::Type::Integer

#pt_xyz_availableInteger

Returns the PT XYZ availability flag

Examples:

entry.pt_xyz_available #=> 1

Returns:

  • (Integer)

    the PT XYZ availability flag



119
# File 'lib/nba/video_status_entry.rb', line 119

attribute :pt_xyz_available, Shale::Type::Integer

#visitor_team_abbreviationString

Returns the visiting team abbreviation

Examples:

entry.visitor_team_abbreviation #=> "GSW"

Returns:

  • (String)

    the visiting team abbreviation



55
# File 'lib/nba/video_status_entry.rb', line 55

attribute :visitor_team_abbreviation, Shale::Type::String

#visitor_team_cityString

Returns the visiting team city

Examples:

entry.visitor_team_city #=> "Golden State"

Returns:

  • (String)

    the visiting team city



39
# File 'lib/nba/video_status_entry.rb', line 39

attribute :visitor_team_city, Shale::Type::String

#visitor_team_idInteger

Returns the visiting team ID

Examples:

entry.visitor_team_id #=> 1610612744

Returns:

  • (Integer)

    the visiting team ID



31
# File 'lib/nba/video_status_entry.rb', line 31

attribute :visitor_team_id, Shale::Type::Integer

#visitor_team_nameString

Returns the visiting team name

Examples:

entry.visitor_team_name #=> "Warriors"

Returns:

  • (String)

    the visiting team name



47
# File 'lib/nba/video_status_entry.rb', line 47

attribute :visitor_team_name, Shale::Type::String

Instance Method Details

#available?Boolean

Returns whether video is available

Examples:

entry.available? #=> true

Returns:

  • (Boolean)

    true if video is available



127
128
129
# File 'lib/nba/video_status_entry.rb', line 127

def available?
  is_available.eql?(1)
end

#home_teamTeam?

Returns the home team object

Examples:

entry.home_team #=> #<NBA::Team>

Returns:

  • (Team, nil)

    the home team object



147
148
149
# File 'lib/nba/video_status_entry.rb', line 147

def home_team
  Teams.find(home_team_id)
end

#pt_xyz_available?Boolean

Returns whether PT XYZ data is available

Examples:

entry.pt_xyz_available? #=> true

Returns:

  • (Boolean)

    true if PT XYZ is available



137
138
139
# File 'lib/nba/video_status_entry.rb', line 137

def pt_xyz_available?
  pt_xyz_available.eql?(1)
end

#visitor_teamTeam?

Returns the visiting team object

Examples:

entry.visitor_team #=> #<NBA::Team>

Returns:

  • (Team, nil)

    the visiting team object



157
158
159
# File 'lib/nba/video_status_entry.rb', line 157

def visitor_team
  Teams.find(visitor_team_id)
end