Class: Stasis::Action
Instance Attribute Summary (collapse)
-
- (Object) _layout
`String` -- Path to the layout for this action.
-
- (Object) _render
`String` -- If present, render this path instead of the default.
-
- (Object) params
`Hash` -- Parameters to be made available to the scope, usually through `Stasis::Server`.
Attributes inherited from Scope
Instance Method Summary (collapse)
-
- (Action) initialize(stasis, options = {})
constructor
A new instance of Action.
Methods inherited from Scope
#_bind_plugin, #_each_plugin_method, #_each_plugins_method, #_send_to_plugin
Constructor Details
- (Action) initialize(stasis, options = {})
A new instance of Action
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/stasis/scope/action.rb', line 19 def initialize(stasis, ={}) @_stasis = stasis @params = [:params] || {} @params = @params.inject({}) do |, (key, value)| [(key.to_sym rescue key) || key] = value end # Some plugins define methods to be made available to action scopes. This call # binds those methods. @_stasis.plugins.each do |plugin| _bind_plugin(plugin, :action_method) end end |
Instance Attribute Details
- (Object) _layout
`String` -- Path to the layout for this action.
10 11 12 |
# File 'lib/stasis/scope/action.rb', line 10 def _layout @_layout end |
- (Object) _render
`String` -- If present, render this path instead of the default.
13 14 15 |
# File 'lib/stasis/scope/action.rb', line 13 def _render @_render end |
- (Object) params
`Hash` -- Parameters to be made available to the scope, usually through `Stasis::Server`.
17 18 19 |
# File 'lib/stasis/scope/action.rb', line 17 def params @params end |