Class: ResourceController::ActionOptions
- Inherits:
-
Object
- Object
- ResourceController::ActionOptions
- Extended by:
- Accessors
- Defined in:
- lib/resource_controller/action_options.rb
Instance Method Summary collapse
-
#initialize ⇒ ActionOptions
constructor
A new instance of ActionOptions.
- #response(*args, &block) ⇒ Object (also: #respond_to, #responds_to)
- #wants ⇒ Object
Constructor Details
#initialize ⇒ ActionOptions
Returns a new instance of ActionOptions.
8 9 10 |
# File 'lib/resource_controller/action_options.rb', line 8 def initialize @collector = ResourceController::ResponseCollector.new end |
Instance Method Details
#response(*args, &block) ⇒ Object Also known as: respond_to, responds_to
12 13 14 15 16 17 18 19 20 |
# File 'lib/resource_controller/action_options.rb', line 12 def response(*args, &block) if !args.empty? || block_given? @collector.clear args.flatten.each { |symbol| @collector.send(symbol) } block.call(@collector) if block_given? end @collector.responses end |
#wants ⇒ Object
24 25 26 |
# File 'lib/resource_controller/action_options.rb', line 24 def wants @collector end |