Class: GameRocket::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/gamerocket/gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Gateway

Returns a new instance of Gateway.



6
7
8
9
10
11
12
13
14
# File 'lib/gamerocket/gateway.rb', line 6

def initialize(config)
  if config.is_a?(Hash)
    @config = Configuration.new config
  elsif config.is_a?(GameRocket::Configuration)
    @config = config  
  else
    raise ArgumentError, "config is an invalid type"
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/gamerocket/gateway.rb', line 4

def config
  @config
end

Instance Method Details

#achievementObject



20
21
22
# File 'lib/gamerocket/gateway.rb', line 20

def achievement
  AchievementGateway.new(self)
end

#actionObject



24
25
26
# File 'lib/gamerocket/gateway.rb', line 24

def action
  ActionGateway.new(self)
end

#gameObject



28
29
30
# File 'lib/gamerocket/gateway.rb', line 28

def game
  GameGateway.new(self)
end

#playerObject



16
17
18
# File 'lib/gamerocket/gateway.rb', line 16

def player
  PlayerGateway.new(self)
end

#purchaseObject



32
33
34
# File 'lib/gamerocket/gateway.rb', line 32

def purchase
  PurchaseGateway.new(self)
end