Class: NBA::PlayoffSeries

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

Overview

Represents a playoff series

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#game_idString

Returns the game ID

Examples:

series.game_id #=> "0042400101"

Returns:

  • (String)

    the game ID



12
# File 'lib/nba/playoff_series.rb', line 12

attribute :game_id, Shale::Type::String

#game_numInteger

Returns the game number in the series

Examples:

series.game_num #=> 1

Returns:

  • (Integer)

    the game number



44
# File 'lib/nba/playoff_series.rb', line 44

attribute :game_num, Shale::Type::Integer

#home_team_idInteger

Returns the home team ID

Examples:

series.home_team_id #=> 1610612744

Returns:

  • (Integer)

    the home team ID



20
# File 'lib/nba/playoff_series.rb', line 20

attribute :home_team_id, Shale::Type::Integer

#series_idString

Returns the series ID

Examples:

series.series_id #=> "0042400101"

Returns:

  • (String)

    the series ID



36
# File 'lib/nba/playoff_series.rb', line 36

attribute :series_id, Shale::Type::String

#visitor_team_idInteger

Returns the visitor team ID

Examples:

series.visitor_team_id #=> 1610612747

Returns:

  • (Integer)

    the visitor team ID



28
# File 'lib/nba/playoff_series.rb', line 28

attribute :visitor_team_id, Shale::Type::Integer

Instance Method Details

#gameGame?

Returns the game object

Examples:

series.game #=> #<NBA::Game>

Returns:

  • (Game, nil)

    the game object



72
73
74
# File 'lib/nba/playoff_series.rb', line 72

def game
  Games.find(game_id)
end

#home_teamTeam?

Returns the home team object

Examples:

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

Returns:

  • (Team, nil)

    the home team object



52
53
54
# File 'lib/nba/playoff_series.rb', line 52

def home_team
  Teams.find(home_team_id)
end

#visitor_teamTeam?

Returns the visitor team object

Examples:

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

Returns:

  • (Team, nil)

    the visitor team object



62
63
64
# File 'lib/nba/playoff_series.rb', line 62

def visitor_team
  Teams.find(visitor_team_id)
end