Class: Loom::Mods::ActionProxy::ActionMap
- Inherits:
-
Object
- Object
- Loom::Mods::ActionProxy::ActionMap
- Defined in:
- lib/loom/mods/action_proxy.rb
Instance Attribute Summary collapse
-
#action_tuples ⇒ Object
readonly
Returns the value of attribute action_tuples.
-
#ns_actionmaps ⇒ Object
readonly
Returns the value of attribute ns_actionmaps.
Instance Method Summary collapse
- #add_action(action_name, bound_method_name, namespace = nil) ⇒ Object
-
#initialize ⇒ ActionMap
constructor
A new instance of ActionMap.
Constructor Details
#initialize ⇒ ActionMap
Returns a new instance of ActionMap.
84 85 86 87 |
# File 'lib/loom/mods/action_proxy.rb', line 84 def initialize @action_tuples = [] @ns_actionmaps = {} end |
Instance Attribute Details
#action_tuples ⇒ Object (readonly)
Returns the value of attribute action_tuples.
82 83 84 |
# File 'lib/loom/mods/action_proxy.rb', line 82 def action_tuples @action_tuples end |
#ns_actionmaps ⇒ Object (readonly)
Returns the value of attribute ns_actionmaps.
82 83 84 |
# File 'lib/loom/mods/action_proxy.rb', line 82 def ns_actionmaps @ns_actionmaps end |
Instance Method Details
#add_action(action_name, bound_method_name, namespace = nil) ⇒ Object
89 90 91 92 93 94 95 96 97 |
# File 'lib/loom/mods/action_proxy.rb', line 89 def add_action(action_name, bound_method_name, namespace=nil) if namespace.nil? tuple = [action_name, bound_method_name] @action_tuples << tuple unless namespace else # Adds an action name to a nested ActionMap add_namespace(namespace).add_action action_name, bound_method_name end end |