Class: MysteryShopper::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/mystery_shopper/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Response

Returns a new instance of Response.



5
6
7
# File 'lib/mystery_shopper/response.rb', line 5

def initialize(data)
  @data = data
end

Instance Method Details

#gamesObject



9
10
11
# File 'lib/mystery_shopper/response.rb', line 9

def games
  data.fetch('games', []).fetch('game', []).map { |game| Game.new(game) }
end