From 7eb09aed874dbb5f50a9ac0d0dec22e42f6161be Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Sun, 20 May 2012 00:50:22 +0200 Subject: Update documentation for AbstractController::Base --- actionpack/lib/abstract_controller/base.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index 97a9eec144..32ec7ced0f 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -51,7 +51,7 @@ module AbstractController # to specify particular actions as hidden. # # ==== Returns - # * array - An array of method names that should not be considered actions. + # * Array - An array of method names that should not be considered actions. def hidden_actions [] end @@ -63,7 +63,7 @@ module AbstractController # itself. Finally, #hidden_actions are removed. # # ==== Returns - # * set - A set of all methods that should be considered actions. + # * Set - A set of all methods that should be considered actions. def action_methods @action_methods ||= begin # All public instance methods of this class, including ancestors @@ -92,11 +92,12 @@ module AbstractController # controller_path. # # ==== Returns - # * string + # * String def controller_path @controller_path ||= name.sub(/Controller$/, '').underscore unless anonymous? end + # Refresh the cached action_methods when a new action_method is added. def method_added(name) super clear_action_methods! @@ -130,6 +131,7 @@ module AbstractController self.class.controller_path end + # Delegates to the class' #action_methods def action_methods self.class.action_methods end @@ -141,6 +143,12 @@ module AbstractController # false and available_action?("foo") returns true because # available action consider actions that are also available # through other means, for example, implicit render ones. + # + # ==== Parameters + # * action_name - The name of an action to be tested + # + # ==== Returns + # * TrueClass, FalseClass def available_action?(action_name) method_for_action(action_name).present? end -- cgit v1.2.3