Module: MetaStrf::ActsAsMetaStrf::ClassMethods
- Defined in:
- lib/meta_strf.rb
Overview
end
Instance Method Summary collapse
Instance Method Details
#acts_as_meta_strf(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/meta_strf.rb', line 10 def ( = {}) default_format = [:default] || "%FT%T" columns.reject{|column| column.type!=:datetime && column.type!=:date }.each do |column| define_method("#{column.name.to_s}_strf") do send(column.name).try(:strftime, default_format) end end end |