Module: BillTrap::Helpers
- Included in:
- Adapters::Ooffice, CLI, Client, Invoice
- Defined in:
- lib/billtrap/helpers.rb
Instance Method Summary collapse
- #format_date(d, format_str = BillTrap::Config['date_format']) ⇒ Object
- #format_money(m, opts = BillTrap::Config['currency_format']) ⇒ Object
- #is_i?(val) ⇒ Boolean
Instance Method Details
#format_date(d, format_str = BillTrap::Config['date_format']) ⇒ Object
8 9 10 |
# File 'lib/billtrap/helpers.rb', line 8 def format_date d, format_str=BillTrap::Config['date_format'] d.strftime(format_str) end |
#format_money(m, opts = BillTrap::Config['currency_format']) ⇒ Object
12 13 14 |
# File 'lib/billtrap/helpers.rb', line 12 def format_money m, opts=BillTrap::Config['currency_format'] m.format(opts) end |
#is_i?(val) ⇒ Boolean
4 5 6 |
# File 'lib/billtrap/helpers.rb', line 4 def is_i? val !!(val.is_a? Integer or val =~ /^\d+$/) end |