Class: EspnPub::Entities::Game

Inherits:
Base
  • Object
show all
Defined in:
lib/espn_pub/entities/game.rb

Overview

Represents a game between two teams.

Instance Attribute Summary collapse

Attributes inherited from Base

#client

Instance Method Summary collapse

Constructor Details

#initialize(id:, home_team_id:, away_team_id:, date:) ⇒ Game

Initialize a Game entity.

Parameters:

  • id (String)

    The game identifier.

  • home_team_id (String)

    The home team identifier.

  • away_team_id (String)

    The away team identifier.

  • date (DateTime)

    The scheduled game date.



15
16
17
18
19
20
21
# File 'lib/espn_pub/entities/game.rb', line 15

def initialize(id:, home_team_id:, away_team_id:, date:)
  @id = id
  @home_team_id = home_team_id
  @away_team_id = away_team_id
  @date = date
  super()
end

Instance Attribute Details

#away_team_idObject (readonly)

Returns the value of attribute away_team_id.



7
8
9
# File 'lib/espn_pub/entities/game.rb', line 7

def away_team_id
  @away_team_id
end

#dateObject (readonly)

Returns the value of attribute date.



7
8
9
# File 'lib/espn_pub/entities/game.rb', line 7

def date
  @date
end

#home_team_idObject (readonly)

Returns the value of attribute home_team_id.



7
8
9
# File 'lib/espn_pub/entities/game.rb', line 7

def home_team_id
  @home_team_id
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/espn_pub/entities/game.rb', line 7

def id
  @id
end