Class: ActionController::MimeResponds::Collector
- Includes:
- AbstractController::Collector
- Defined in:
- actionpack/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(mimes, &block) ⇒ Collector
constructor
A new instance of Collector.
- #response_for(mime) ⇒ Object
Methods included from AbstractController::Collector
Constructor Details
#initialize(mimes, &block) ⇒ Collector
Returns a new instance of Collector.
285 286 287 288 |
# File 'actionpack/lib/action_controller/metal/mime_responds.rb', line 285 def initialize(mimes, &block) @order, @responses, @default_response = [], {}, block mimes.each { |mime| send(mime) } 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
283 284 285 |
# File 'actionpack/lib/action_controller/metal/mime_responds.rb', line 283 def order @order end |
Instance Method Details
#any(*args, &block) ⇒ Object Also known as: all
290 291 292 293 294 295 296 |
# File 'actionpack/lib/action_controller/metal/mime_responds.rb', line 290 def any(*args, &block) if args.any? args.each { |type| send(type, &block) } else custom(Mime::ALL, &block) end end |