Module: Merb::ResponderMixin::ClassMethods
- Defined in:
- merb-core/lib/merb-core/controller/mixins/responder.rb
Instance Method Summary (collapse)
-
- (Array) clear_provides
Clear the list of provides.
-
- (Array<Symbol>) does_not_provide(*formats)
This class should not provide any of this list of formats, despite any.
-
- (Array<Symbol>) only_provides(*formats)
This class should only provide the formats listed here, despite any other definitions previously or in superclasses.
-
- (Array<Symbol>) provides(*formats)
Adds symbols representing formats to the controller's default list of provided_formats.
-
- (Array<Symbol>) reset_provides
Reset the list of provides to include only :html.
Instance Method Details
- (Array) clear_provides
Clear the list of provides.
171 172 173 |
# File 'merb-core/lib/merb-core/controller/mixins/responder.rb', line 171 def clear_provides self.class_provided_formats.clear end |
- (Array<Symbol>) does_not_provide(*formats)
This class should not provide any of this list of formats, despite any. other definitions previously or in superclasses.
162 163 164 |
# File 'merb-core/lib/merb-core/controller/mixins/responder.rb', line 162 def does_not_provide(*formats) self.class_provided_formats -= formats end |
- (Array<Symbol>) only_provides(*formats)
This class should only provide the formats listed here, despite any other definitions previously or in superclasses.
148 149 150 151 |
# File 'merb-core/lib/merb-core/controller/mixins/responder.rb', line 148 def only_provides(*formats) clear_provides provides(*formats) end |
- (Array<Symbol>) provides(*formats)
Adds symbols representing formats to the controller's default list of
providedformats. These will apply to every action in the controller,
unless modified in the action. If the last argument is a Hash or an
Array, these are regarded as arguments to pass to the to
136 137 138 |
# File 'merb-core/lib/merb-core/controller/mixins/responder.rb', line 136 def provides(*formats) self.class_provided_formats |= formats end |
- (Array<Symbol>) reset_provides
Reset the list of provides to include only :html.
180 181 182 |
# File 'merb-core/lib/merb-core/controller/mixins/responder.rb', line 180 def reset_provides only_provides(:html) end |