Sha256: 790ebc221ac05b2e8c5530e9b7bedb25a0b394b790669cf64be4031191e61367
Contents?: true
Size: 391 Bytes
Versions: 5
Compression:
Stored size: 391 Bytes
Contents
module ActionPresenter module Defaults module Timestamps [:created_at, :updated_at].each do |timestamp| define_method timestamp do |format = :default| localize_time timestamp, format end end private def localize_time(time, format) I18n.l(object.try(time), format: format) if object.respond_to?(time) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems