Class: Kaui::Subscription

Inherits:
Base
  • Object
show all
Defined in:
app/models/kaui/subscription.rb

Instance Attribute Summary

Attributes inherited from Base

#errors

Instance Method Summary collapse

Methods inherited from Base

#==, all, #attributes=, camelize, convert_hash_keys, count, define_attr, #destroy, find, from_json, has_many, has_one, human_attribute_name, lookup_ancestors, #new_record?, #persisted?, #read_attribute_for_validation, #save, #to_hash, to_money, #to_param, #update_attributes

Constructor Details

#initialize(data = {}) ⇒ Subscription

Returns a new instance of Subscription.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/kaui/subscription.rb', line 14

def initialize(data = {})
  super(:subscription_id => data['subscriptionId'] || data['subscription_id'],
        :bundle_id => data['bundleId'] || data['bundle_id'],
        :product_category => data['productCategory'] || data['product_category'],
        :product_name => data['productName'] || data['product_name'],
        :billing_period => data['billingPeriod'] || data['billing_period'],
        :charged_through_date => data['chargedThroughDate'] || data['charged_through_date'],
        :price_list => data['priceList'] || data['price_list'],
        :start_date => data['startDate'] || data['start_date'],
        :canceled_date => data['cancelledDate'] || data['canceled_date'],
        :events => data['events'])
end