Sha256: 5ead64ff92193a2e662d47ae82a2343d8a769f36857d9964dd05a18acea1f2a6
Contents?: true
Size: 1.5 KB
Versions: 4
Compression:
Stored size: 1.5 KB
Contents
require 'active_model' class Kaui::Account < Kaui::Base define_attr :account_id define_attr :external_key define_attr :name define_attr :first_name_length define_attr :email define_attr :currency define_attr :payment_method_id define_attr :timezone define_attr :address1 define_attr :address2 define_attr :company define_attr :state define_attr :country define_attr :phone define_attr :balance define_attr :is_notified_for_invoices has_one :bill_cycle_day, Kaui::BillCycleDay def initialize(data = {}) super(:account_id => data['accountId'], :external_key => data['externalKey'], :name => data['name'] || "#{data['firstName'] || ''}#{data.has_key?('firstName') ? ' ' : ''}#{data['lastName'] || ''}", :first_name_length => data['length'] || (data.has_key?('firstName') ? data['firstName'].length : 0), :email => data['email'], :currency => data['currency'], :payment_method_id => data['paymentMethodId'], :timezone => data['timeZone'] || data['time_zone'] || data['timezone'], :address1 => data['address1'], :address2 => data['address2'], :company => data['company'], :state => data['state'], :country => data['country'], :phone => data['phone'], :bill_cycle_day => data['billCycleDay'], :balance => data['accountBalance'], :is_notified_for_invoices => data['isNotifiedForInvoices']) end def to_param @account_id end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
kaui-0.1.6 | app/models/kaui/account.rb |
kaui-0.1.5 | app/models/kaui/account.rb |
kaui-0.1.4 | app/models/kaui/account.rb |
kaui-0.1.3 | app/models/kaui/account.rb |