Class: MeducationSDK::Purchases
- Inherits:
-
Object
- Object
- MeducationSDK::Purchases
- Includes:
- Helpers
- Defined in:
- lib/meducation_sdk/services/purchases.rb
Constant Summary
Constants included from Helpers
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#purchase_option_id ⇒ Object
readonly
Returns the value of attribute purchase_option_id.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(user, purchase_option_id, order) ⇒ Purchases
constructor
A new instance of Purchases.
Methods included from Helpers
#sdk_class_for, #sdk_type_for, #spi_type_for
Constructor Details
#initialize(user, purchase_option_id, order) ⇒ Purchases
Returns a new instance of Purchases.
11 12 13 14 15 |
# File 'lib/meducation_sdk/services/purchases.rb', line 11 def initialize(user, purchase_option_id, order) @user = user @purchase_option_id = purchase_option_id @order = order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
9 10 11 |
# File 'lib/meducation_sdk/services/purchases.rb', line 9 def order @order end |
#purchase_option_id ⇒ Object (readonly)
Returns the value of attribute purchase_option_id.
9 10 11 |
# File 'lib/meducation_sdk/services/purchases.rb', line 9 def purchase_option_id @purchase_option_id end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
9 10 11 |
# File 'lib/meducation_sdk/services/purchases.rb', line 9 def user @user end |
Class Method Details
.create(user, purchase_option_id, order) ⇒ Object
5 6 7 |
# File 'lib/meducation_sdk/services/purchases.rb', line 5 def self.create(user, purchase_option_id, order) new(user, purchase_option_id, order).create end |
Instance Method Details
#create ⇒ Object
17 18 19 |
# File 'lib/meducation_sdk/services/purchases.rb', line 17 def create Loquor.post("/purchases", {user: @user, purchase_option_id: @purchase_option_id, order: @order}) end |