Class: ActionController::MimeResponds::Collector
- Inherits:
-
Object
- Object
- ActionController::MimeResponds::Collector
- Includes:
- AbstractController::Collector
- Defined in:
- lib/action_controller/metal/mime_responds.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#order ⇒ Object
Returns the value of attribute order.
Instance Method Summary collapse
- #any(*args, &block) ⇒ Object (also: #all)
- #custom(mime_type, &block) ⇒ Object
-
#initialize(&block) ⇒ Collector
constructor
A new instance of Collector.
- #response_for(mime) ⇒ Object
Methods included from AbstractController::Collector
Constructor Details
#initialize(&block) ⇒ Collector
Returns a new instance of Collector.
280 281 282 |
# File 'lib/action_controller/metal/mime_responds.rb', line 280 def initialize(&block) @order, @responses, @default_response = [], {}, block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AbstractController::Collector
Instance Attribute Details
#order ⇒ Object
Returns the value of attribute order.
278 279 280 |
# File 'lib/action_controller/metal/mime_responds.rb', line 278 def order @order end |
Instance Method Details
#any(*args, &block) ⇒ Object Also known as: all
284 285 286 287 288 289 290 |
# File 'lib/action_controller/metal/mime_responds.rb', line 284 def any(*args, &block) if args.any? args.each { |type| send(type, &block) } else custom(Mime::ALL, &block) end end |