class Stringento::Formatter
Base class / base implementation of a formatter. In order to customize formatting:
-
Derive subclass
-
Implement formatter methods ending in: _formatter.
-
Pass instance into into Stringento#evaluate
Constants
- METHOD_SUFFIX
Public Instance Methods
formatter(method, value, arg = '')
click to toggle source
# File lib/stringento/formatter.rb, line 21 def formatter(method, value, arg = '') method_name = "#{method}#{METHOD_SUFFIX}" if respond_to?(method_name) send(method_name, value, arg) else value.to_s end end