Class: Metacritic::Game
- Inherits:
-
Object
- Object
- Metacritic::Game
- Defined in:
- lib/metacritic/Game.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #developer ⇒ Object
- #genre ⇒ Object
-
#initialize(response) ⇒ Game
constructor
A new instance of Game.
- #name ⇒ Object
- #platform ⇒ Object
- #publisher ⇒ Object
- #rating ⇒ Object
- #rlsdate ⇒ Object
- #score ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(response) ⇒ Game
Returns a new instance of Game.
7 8 9 |
# File 'lib/metacritic/Game.rb', line 7 def initialize(response) @response = response.body["result"] end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/metacritic/Game.rb', line 5 def response @response end |
Instance Method Details
#developer ⇒ Object
39 40 41 |
# File 'lib/metacritic/Game.rb', line 39 def developer @response["developer"] end |
#genre ⇒ Object
23 24 25 |
# File 'lib/metacritic/Game.rb', line 23 def genre @response["genre"] end |
#name ⇒ Object
11 12 13 |
# File 'lib/metacritic/Game.rb', line 11 def name @response["name"] end |
#platform ⇒ Object
31 32 33 |
# File 'lib/metacritic/Game.rb', line 31 def platform @response["platform"] end |
#publisher ⇒ Object
35 36 37 |
# File 'lib/metacritic/Game.rb', line 35 def publisher @response["publisher"] end |
#rating ⇒ Object
27 28 29 |
# File 'lib/metacritic/Game.rb', line 27 def @response["rating"] end |
#rlsdate ⇒ Object
19 20 21 |
# File 'lib/metacritic/Game.rb', line 19 def rlsdate @response["rlsdate"] end |
#score ⇒ Object
15 16 17 |
# File 'lib/metacritic/Game.rb', line 15 def score @response["score"].to_i end |
#url ⇒ Object
43 44 45 |
# File 'lib/metacritic/Game.rb', line 43 def url @response["url"] end |