Class: GameRocket::Purchase
- Inherits:
-
Object
- Object
- GameRocket::Purchase
- Defined in:
- lib/gamerocket/purchase.rb
Instance Attribute Summary collapse
-
#dynProp ⇒ Object
Returns the value of attribute dynProp.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#ref ⇒ Object
Returns the value of attribute ref.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(gateway, attributes) ⇒ Purchase
constructor
A new instance of Purchase.
Constructor Details
#initialize(gateway, attributes) ⇒ Purchase
Returns a new instance of Purchase.
6 7 8 9 10 11 12 |
# File 'lib/gamerocket/purchase.rb', line 6 def initialize(gateway, attributes) @gateway = gateway if !attributes.nil? set_instance_variables_from_hash(attributes) self.dynProp = attributes[:dynProp].is_a?(Hash) ? attributes[:dynProp] : {} end end |
Instance Attribute Details
#dynProp ⇒ Object
Returns the value of attribute dynProp.
4 5 6 |
# File 'lib/gamerocket/purchase.rb', line 4 def dynProp @dynProp end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/gamerocket/purchase.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/gamerocket/purchase.rb', line 4 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
4 5 6 |
# File 'lib/gamerocket/purchase.rb', line 4 def price @price end |
#ref ⇒ Object
Returns the value of attribute ref.
4 5 6 |
# File 'lib/gamerocket/purchase.rb', line 4 def ref @ref end |
Class Method Details
._new(*args) ⇒ Object
22 23 24 |
# File 'lib/gamerocket/purchase.rb', line 22 def self._new(*args) self.new *args end |
.buy(id, attributes) ⇒ Object
18 19 20 |
# File 'lib/gamerocket/purchase.rb', line 18 def self.buy(id, attributes) Configuration.gateway.purchase.buy(id, attributes) end |
.find(id) ⇒ Object
14 15 16 |
# File 'lib/gamerocket/purchase.rb', line 14 def self.find(id) Configuration.gateway.purchase.find(id) end |