- A
- D
- I
- M
- N
- P
- R
- T
Attributes
| [R] | id | |
| [R] | status |
Class Public methods
model_name() Link
Source: show
# File app/models/billing/charge.rb, line 44 def self.model_name @_model_name ||= ActiveModel::Name.new(self) end
new(data:, invoice_policy: Service::InvoicePolicy::StripeCharge) Link
Source: show
# File app/models/billing/charge.rb, line 5 def initialize(data:, invoice_policy: Service::InvoicePolicy::StripeCharge) @raw_data = data @policy = invoice_policy.new(@raw_data) @data = @policy.data @id = @data[:id] @status = @data[:status] end
Instance Public methods
amount() Link
Source: show
# File app/models/billing/charge.rb, line 13 def amount Service::Money.new(@data[:total], @data[:currency]).format end
amount_due() Link
Source: show
# File app/models/billing/charge.rb, line 17 def amount_due Service::Money.new(@data[:amount_due], @data[:currency]).format end
date() Link
Source: show
# File app/models/billing/charge.rb, line 21 def date format_timestamp @data[:timestamp] end
date_short() Link
Source: show
# File app/models/billing/charge.rb, line 25 def date_short time = Time.zone.at @data[:timestamp] I18n.l(time, format: :short_ordinal) end
invoice() Link
Source: show
# File app/models/billing/charge.rb, line 36 def invoice @invoice ||= get_invoice end
policy_type() Link
Source: show
# File app/models/billing/charge.rb, line 40 def policy_type @policy.class end