Class: Merb::Router::ResourceBehavior
- Defined in:
- lib/merb-core/dispatch/router/resources.rb
Overview
Adding the collection and member methods to behavior
Instance Method Summary collapse
-
#collection(action, options = {}) ⇒ Object
:api: private.
-
#initialize(builders, *args) ⇒ ResourceBehavior
constructor
:api: private.
-
#member(action, options = {}) ⇒ Object
:api: private.
Methods inherited from Behavior
#_with_proxy, #capture, #default, #default_routes, #defer, #defer_to, #fixatable, #full_name, #identify, #match, #name, #namespace, #redirect, #to
Methods included from Resources
Constructor Details
#initialize(builders, *args) ⇒ ResourceBehavior
:api: private
305 306 307 308 309 |
# File 'lib/merb-core/dispatch/router/resources.rb', line 305 def initialize(builders, *args) super(*args) @collection = builders[:collection] @member = builders[:member] end |
Instance Method Details
#collection(action, options = {}) ⇒ Object
:api: private
312 313 314 315 316 317 |
# File 'lib/merb-core/dispatch/router/resources.rb', line 312 def collection(action, = {}) action = action.to_s method = [:method] to = [:to] || action @collection[action, to, method] end |
#member(action, options = {}) ⇒ Object
:api: private
320 321 322 323 324 325 |
# File 'lib/merb-core/dispatch/router/resources.rb', line 320 def member(action, = {}) action = action.to_s method = [:method] to = [:to] || action @member[action, to, method] end |