Skip to Content Skip to Search
Methods
A
D
N

Attributes

[R] description
[R] plan_id

Class Public methods

new(data)

# File app/models/billing/invoice_item.rb, line 5
def initialize(data)
  @amount = data.amount
  @currency = data.currency
  @description = data.description

  @timestamp = data.try(:timestamp)
  @timestamp_start = data.try(:timestamp_start)
  @timestamp_end = data.try(:timestamp_end)
  @plan_id = data.try(:plan_id)
end

Instance Public methods

amount()

# File app/models/billing/invoice_item.rb, line 16
def amount
  Service::Money.new(@amount, @currency).format
end

date()

# File app/models/billing/invoice_item.rb, line 20
def date
  if @timestamp_start && @timestamp_end
    date_timeframe
  elsif @timestamp
    format_timestamp @timestamp
  else
    false
  end
end