Class: Coalla::TableFormatter::DateFormatter
- Inherits:
-
SimpleFormatter
- Object
- SimpleFormatter
- Coalla::TableFormatter::DateFormatter
- Defined in:
- lib/coalla/builders/table_formatter.rb
Instance Method Summary collapse
- #customize(item) ⇒ Object
-
#initialize(default_format = '%d.%m.%Y') ⇒ DateFormatter
constructor
A new instance of DateFormatter.
Methods inherited from SimpleFormatter
Constructor Details
#initialize(default_format = '%d.%m.%Y') ⇒ DateFormatter
Returns a new instance of DateFormatter.
28 29 30 |
# File 'lib/coalla/builders/table_formatter.rb', line 28 def initialize(default_format = '%d.%m.%Y') @default_format = default_format end |
Instance Method Details
#customize(item) ⇒ Object
32 33 34 35 |
# File 'lib/coalla/builders/table_formatter.rb', line 32 def customize(item) item = item.localtime if item.respond_to?(:localtime) Russian::strftime(item, @default_format) end |