Class: RespondForHelper::Lookups::Format
- Inherits:
-
Object
- Object
- RespondForHelper::Lookups::Format
- Defined in:
- lib/respond_for_helper/lookups/format.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(controller, options) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(controller, options) ⇒ Format
Returns a new instance of Format.
6 7 8 9 10 11 |
# File 'lib/respond_for_helper/lookups/format.rb', line 6 def initialize(controller, ) @controller = controller @options = @controller_config = @controller.class.respond_for_config end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 |
# File 'lib/respond_for_helper/lookups/format.rb', line 13 def call formats = adjust_formats(resolve_formats.deep_dup) formatters = resolve_formatters formatters.select { |format, _| formats.include?(format) }.to_h end |