Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/merb_global/base.rb

Instance Method Summary collapse

Instance Method Details

#localize(format, args = {}) ⇒ Object

call-seq:

localize(format) => localized date

Format the string using the current locale

Parameters

format<String>

The format - in similar format to Time.to_s

opts<Hash>

Options of translations

Options (opts)

locale<Locale>

The translation in other locale



94
95
96
97
98
# File 'lib/merb_global/base.rb', line 94

def localize(format, args = {})
  opts = {:locale => Merb::Global::Locale.current}
  opts.merge!(args)
  Merb::Global::DateProviders.provider.localize opts[:locale], self, format
end