Module: ResponseForRc::ResponsesModule

Includes:
ResourcesController::IncludeActions
Included in:
Actions, SingletonActions
Defined in:
lib/response_for_rc/responses_module.rb

Overview

Just like ResponseFor::ResponsesModule, but also handles the :except, :only options

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mixin) ⇒ Object



6
7
8
# File 'lib/response_for_rc/responses_module.rb', line 6

def self.extended(mixin)
  mixin.extend ResponseFor::ResponsesModule
end

Instance Method Details

#cloneObject

when we clone, we need to copy our action_responses



18
19
20
21
22
# File 'lib/response_for_rc/responses_module.rb', line 18

def clone
  c=super
  c.instance_variable_set('@action_responses', action_responses.clone)
  c
end

#remove_action_method(action) ⇒ Object

as well as undefing an exlcuded action from the dup mixin, we also remove its response



12
13
14
15
# File 'lib/response_for_rc/responses_module.rb', line 12

def remove_action_method(action)
  undef_method action
  remove_response_for action
end