Sha256: 7f4bd54236d31abbd6046aa3ac3a9b7146b6f154b68c9844fb7102629bdf9d1e

Contents?: true

Size: 417 Bytes

Versions: 7

Compression:

Stored size: 417 Bytes

Contents

# note that this custom class is specific for testing (value contains minitest assertions)
class DateColumn < DiningTable::Columns::Column
  def value(object)
    val = super
    val.class.name.must_equal 'Date'  # make sure an actual object is returned, not a string representation
    self.class.localize( val ) if val
  end
  
  def self.localize(date)
    "#{ date.day }/#{ date.month }/#{ date.year }"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dining-table-1.1.3 spec/date_column.rb
dining-table-1.1.2 spec/date_column.rb
dining-table-1.1.1 spec/date_column.rb
dining-table-1.1.0 spec/date_column.rb
dining-table-1.0.0 spec/date_column.rb
dining-table-0.2.1 spec/date_column.rb
dining-table-0.2.0 spec/date_column.rb