Class: View::Auto
Overview
The auto formatter tries to figure out what other formatter should be the most appropriate to use and delegates the formatting to that formatter.
This is fully configurable too. See Auto.add
Instance Attribute Summary
Attributes inherited from Formatter
Class Method Summary (collapse)
-
+ (Object) add(formatter_name) { ... }
Adds behavior to check which view should automatically be used.
Instance Method Summary (collapse)
Methods inherited from Formatter
#all_options, as, #format!, inherited, #options, skip_blank_formatter, #to_s, type
Class Method Details
+ (Object) add(formatter_name) { ... }
Adds behavior to check which view should automatically be used.
27 28 29 |
# File 'lib/view/formatters/auto.rb', line 27 def self.add(formatter_name, &block) auto_formatters.unshift(:formatter => formatter_name, :block => block) end |
Instance Method Details
- (Object) format
31 32 33 |
# File 'lib/view/formatters/auto.rb', line 31 def format formatted_value end |