Class: GiantBomb::Game

Inherits:
Object show all
Includes:
Attributes
Defined in:
lib/giant_bomb/game.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(values, client) ⇒ Game

Returns a new instance of Game.



19
20
21
22
# File 'lib/giant_bomb/game.rb', line 19

def initialize(values, client)
  @client = client
  self.attributes = values
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/giant_bomb/game.rb', line 4

def client
  @client
end

Instance Method Details

#get_info!Object



24
25
26
27
28
# File 'lib/giant_bomb/game.rb', line 24

def get_info!
  game = client.get_game_info(self.id)
  @attributes.merge!(game.attributes) if game
  @loaded = true
end