Class: Date

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 Date.to_s

opts<Hash>

Options of translations

Options (opts)

locale<Locale>

The translation in other locale



58
59
60
61
62
# File 'lib/merb_global/base.rb', line 58

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