class SimpleAttribute::Attributes::Date
Public Instance Methods
date_format()
click to toggle source
# File lib/simple_attribute/attributes/date.rb, line 8 def date_format options.fetch :format, default_format end
default_format()
click to toggle source
# File lib/simple_attribute/attributes/date.rb, line 4 def default_format '<date>%d %b %Y</date>' end
render_attribute()
click to toggle source
# File lib/simple_attribute/attributes/date.rb, line 12 def render_attribute value.try :strftime, date_format end