Class: NFL::LiveUpdate::GameCenter::Game
- Inherits:
-
Object
- Object
- NFL::LiveUpdate::GameCenter::Game
- Includes:
- HTTParty
- Defined in:
- lib/nfl/live_update/game_center/game.rb
Instance Attribute Summary collapse
-
#away ⇒ Object
Returns the value of attribute away.
-
#home ⇒ Object
Returns the value of attribute home.
-
#id ⇒ Object
Returns the value of attribute id.
-
#json ⇒ Object
Returns the value of attribute json.
-
#next_update ⇒ Object
Returns the value of attribute next_update.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ Game
constructor
A new instance of Game.
Constructor Details
#initialize(json) ⇒ Game
Returns a new instance of Game.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nfl/live_update/game_center/game.rb', line 17 def initialize(json) @next_update = json.delete("nextupdate") @id = json.keys.first json = json[@id.to_s] @home = Team.new(json["home"]) @away = Team.new(json["away"]) @json = json @json.delete("home") @json.delete("away") end |
Instance Attribute Details
#away ⇒ Object
Returns the value of attribute away.
14 15 16 |
# File 'lib/nfl/live_update/game_center/game.rb', line 14 def away @away end |
#home ⇒ Object
Returns the value of attribute home.
14 15 16 |
# File 'lib/nfl/live_update/game_center/game.rb', line 14 def home @home end |
#id ⇒ Object
Returns the value of attribute id.
14 15 16 |
# File 'lib/nfl/live_update/game_center/game.rb', line 14 def id @id end |
#json ⇒ Object
Returns the value of attribute json.
14 15 16 |
# File 'lib/nfl/live_update/game_center/game.rb', line 14 def json @json end |
#next_update ⇒ Object
Returns the value of attribute next_update.
14 15 16 |
# File 'lib/nfl/live_update/game_center/game.rb', line 14 def next_update @next_update end |
Class Method Details
.find(id) ⇒ Object
31 32 33 |
# File 'lib/nfl/live_update/game_center/game.rb', line 31 def find(id) new(get(relative_url(id))) end |