Module: HtmlTables::FormatForOutput

Defined in:
lib/html_tables/format_for_output.rb

Instance Method Summary collapse

Instance Method Details

#format_for_outputObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/html_tables/format_for_output.rb', line 5

def format_for_output
  return to_label(:short) if respond_to?(:to_label)
  case self
    when Date, Time, DateTime
      I18n.l(self, format: :short)
    when TrueClass, FalseClass
      I18n.t(self.to_s)
    else
      self
  end
end