Class: View::Guess

Inherits:
Formatter show all
Defined in:
lib/view/formatters/guess.rb

Overview

This formatter is the fallback formatter for auto. It figures out which method will be called to get a proper version to render.

Instance Attribute Summary

Attributes inherited from Formatter

#block, #template, #value

Instance Method Summary (collapse)

Methods inherited from Formatter

#all_options, as, #format!, inherited, #options, skip_blank_formatter, #to_s, type

Instance Method Details

- (Object) format



9
10
11
12
13
14
# File 'lib/view/formatters/guess.rb', line 9

def format
  View.configuration.guessing_methods.each do |method|
    return value.send(method) if value.respond_to?(method)
  end
  value
end