Class: GameRocket::Gateway
- Inherits:
-
Object
- Object
- GameRocket::Gateway
- Defined in:
- lib/gamerocket/gateway.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #achievement ⇒ Object
- #action ⇒ Object
- #game ⇒ Object
-
#initialize(config) ⇒ Gateway
constructor
A new instance of Gateway.
- #player ⇒ Object
- #purchase ⇒ Object
Constructor Details
#initialize(config) ⇒ 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
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/gamerocket/gateway.rb', line 4 def config @config end |
Instance Method Details
#achievement ⇒ Object
20 21 22 |
# File 'lib/gamerocket/gateway.rb', line 20 def achievement AchievementGateway.new(self) end |
#action ⇒ Object
24 25 26 |
# File 'lib/gamerocket/gateway.rb', line 24 def action ActionGateway.new(self) end |
#game ⇒ Object
28 29 30 |
# File 'lib/gamerocket/gateway.rb', line 28 def game GameGateway.new(self) end |
#player ⇒ Object
16 17 18 |
# File 'lib/gamerocket/gateway.rb', line 16 def player PlayerGateway.new(self) end |
#purchase ⇒ Object
32 33 34 |
# File 'lib/gamerocket/gateway.rb', line 32 def purchase PurchaseGateway.new(self) end |