Module: StripeInvoice::ApplicationHelper

Defined in:
app/helpers/stripe_invoice/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_timestamp(timestamp) ⇒ Object Also known as: ft



4
5
6
7
8
9
10
11
12
# File 'app/helpers/stripe_invoice/application_helper.rb', line 4

def format_timestamp(timestamp)
  dt = timestamp
  
  unless timestamp.is_a? DateTime
    dt = Time.at(timestamp).to_datetime
  end
  
  l(dt, :format => :short_date)
end

#stripe_invoice_controller?Boolean

returns TRUE if the controller belongs to StripeInvoice false in all other cases, for convenience when executing filters in the main application

Returns:

  • (Boolean)


19
20
21
# File 'app/helpers/stripe_invoice/application_helper.rb', line 19

def stripe_invoice_controller? 
  is_a? StripeInvoice::ApplicationController
end