Class: TableHelper::SimpleColumn
- Defined in:
- lib/table_for/simple_column.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Column
Instance Method Summary collapse
Methods inherited from Column
Constructor Details
This class inherits a constructor from TableHelper::Column
Instance Method Details
#content_for(record) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/table_for/simple_column.rb', line 3 def content_for(record) called_record = record.kind_of?(Hash) ? record[@attr] : record.send(@attr) if [:attr] && called_record.respond_to?([:attr]) called_record = called_record.send([:attr]) end if [:default] && called_record.nil? called_record = [:default] end if [:time_format] and called_record.is_a? Time called_record = called_record.strftime([:time_format]) end called_record.to_s end |