Update documentation for AbstractController::Base

This commit is contained in:
Henrik Hodne 2012-05-20 00:50:22 +02:00
parent a6940f2a83
commit 7eb09aed87

@ -51,7 +51,7 @@ def internal_methods
# to specify particular actions as hidden.
#
# ==== Returns
# * <tt>array</tt> - An array of method names that should not be considered actions.
# * <tt>Array</tt> - An array of method names that should not be considered actions.
def hidden_actions
[]
end
@ -63,7 +63,7 @@ def hidden_actions
# itself. Finally, #hidden_actions are removed.
#
# ==== Returns
# * <tt>set</tt> - A set of all methods that should be considered actions.
# * <tt>Set</tt> - 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 @@ def clear_action_methods!
# controller_path.
#
# ==== Returns
# * <tt>string</tt>
# * <tt>String</tt>
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 @@ def controller_path
self.class.controller_path
end
# Delegates to the class' #action_methods
def action_methods
self.class.action_methods
end
@ -141,6 +143,12 @@ def action_methods
# false and <tt>available_action?("foo")</tt> returns true because
# available action consider actions that are also available
# through other means, for example, implicit render ones.
#
# ==== Parameters
# * <tt>action_name</tt> - The name of an action to be tested
#
# ==== Returns
# * <tt>TrueClass</tt>, <tt>FalseClass</tt>
def available_action?(action_name)
method_for_action(action_name).present?
end