Class: NBA::UpcomingGame

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

Overview

Represents an upcoming game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#game_dateString

Returns the game date

Examples:

game.game_date #=> "2024-10-22T00:00:00"

Returns:

  • (String)

    the game date



25
# File 'lib/nba/upcoming_game.rb', line 25

attribute :game_date, Shale::Type::String

#game_idString

Returns the game ID

Examples:

game.game_id #=> "0022400001"

Returns:

  • (String)

    the game ID



17
# File 'lib/nba/upcoming_game.rb', line 17

attribute :game_id, Shale::Type::String

#game_timeString

Returns the game time

Examples:

game.game_time #=> "7:30 PM"

Returns:

  • (String)

    the game time



33
# File 'lib/nba/upcoming_game.rb', line 33

attribute :game_time, Shale::Type::String

#home_team_abbreviationString

Returns the home team abbreviation

Examples:

game.home_team_abbreviation #=> "GSW"

Returns:

  • (String)

    the home team abbreviation



73
# File 'lib/nba/upcoming_game.rb', line 73

attribute :home_team_abbreviation, Shale::Type::String

#home_team_idInteger

Returns the home team ID

Examples:

game.home_team_id #=> 1610612744

Returns:

  • (Integer)

    the home team ID



41
# File 'lib/nba/upcoming_game.rb', line 41

attribute :home_team_id, Shale::Type::Integer

#home_team_nameString

Returns the home team full name

Examples:

game.home_team_name #=> "Golden State Warriors"

Returns:

  • (String)

    the home team name



57
# File 'lib/nba/upcoming_game.rb', line 57

attribute :home_team_name, Shale::Type::String

#home_team_nicknameString

Returns the home team nickname

Examples:

game.home_team_nickname #=> "Warriors"

Returns:

  • (String)

    the home team nickname



89
# File 'lib/nba/upcoming_game.rb', line 89

attribute :home_team_nickname, Shale::Type::String

#visitor_team_abbreviationString

Returns the visitor team abbreviation

Examples:

game.visitor_team_abbreviation #=> "LAL"

Returns:

  • (String)

    the visitor team abbreviation



81
# File 'lib/nba/upcoming_game.rb', line 81

attribute :visitor_team_abbreviation, Shale::Type::String

#visitor_team_idInteger

Returns the visitor team ID

Examples:

game.visitor_team_id #=> 1610612747

Returns:

  • (Integer)

    the visitor team ID



49
# File 'lib/nba/upcoming_game.rb', line 49

attribute :visitor_team_id, Shale::Type::Integer

#visitor_team_nameString

Returns the visitor team full name

Examples:

game.visitor_team_name #=> "Los Angeles Lakers"

Returns:

  • (String)

    the visitor team name



65
# File 'lib/nba/upcoming_game.rb', line 65

attribute :visitor_team_name, Shale::Type::String

#visitor_team_nicknameString

Returns the visitor team nickname

Examples:

game.visitor_team_nickname #=> "Lakers"

Returns:

  • (String)

    the visitor team nickname



97
# File 'lib/nba/upcoming_game.rb', line 97

attribute :visitor_team_nickname, Shale::Type::String

Instance Method Details

#home_teamTeam?

Returns the home team object

Examples:

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

Returns:

  • (Team, nil)

    the home team



105
# File 'lib/nba/upcoming_game.rb', line 105

def home_team = Teams.find(home_team_id)

#visitor_teamTeam?

Returns the visitor team object

Examples:

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

Returns:

  • (Team, nil)

    the visitor team



113
# File 'lib/nba/upcoming_game.rb', line 113

def visitor_team = Teams.find(visitor_team_id)