Class: Kaui::Credit

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

Constant Summary collapse

SAMPLE_REASON_CODES =
[ "100 - Courtesy",
"101 - Billing Error",
"199 - OTHER" ]

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 = {}) ⇒ Credit

Returns a new instance of Credit.



14
15
16
17
18
19
20
# File 'app/models/kaui/credit.rb', line 14

def initialize(data = {})
  super(:account_id => data['accountId'] || data['account_id'],
        :invoice_id => data['invoiceId'] || data['invoice_id'],
        :credit_amount => data['creditAmount'] || data['credit_amount'],
        :requested_date => data['requestedDate'] || data['requested_date'],
        :effective_date => data['effectiveDate'] || data['effective_date'])
end