Class: Scruffy::Formatters::Date
Instance Method Summary collapse
-
#format(target, idx, options) ⇒ Object
Formats percentages.
-
#initialize(format_string, options = {}) ⇒ Date
constructor
A new instance of Date.
Methods inherited from Base
Constructor Details
#initialize(format_string, options = {}) ⇒ Date
Returns a new instance of Date.
216 217 218 |
# File 'lib/scruffy/formatters.rb', line 216 def initialize(format_string, = {}) @format_string = format_string end |
Instance Method Details
#format(target, idx, options) ⇒ Object
Formats percentages.
221 222 223 224 225 226 227 |
# File 'lib/scruffy/formatters.rb', line 221 def format(target, idx, ) begin target.strftime(@format_string) rescue target end end |