Class: Stasis::Action
Instance Attribute Summary collapse
-
#_layout ⇒ Object
‘String` – Path to the layout for this action.
-
#_render ⇒ Object
‘String` – If present, render this path instead of the default.
-
#params ⇒ Object
‘Hash` – Parameters to be made available to the scope, usually through `Stasis::Server`.
Attributes inherited from Scope
Instance Method Summary collapse
-
#initialize(stasis, options = {}) ⇒ Action
constructor
A new instance of Action.
Methods inherited from Scope
#_bind_plugin, #_each_plugin_method, #_each_plugins_method, #_send_to_plugin
Constructor Details
#initialize(stasis, options = {}) ⇒ Action
Returns 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
#_layout ⇒ Object
‘String` – Path to the layout for this action.
10 11 12 |
# File 'lib/stasis/scope/action.rb', line 10 def _layout @_layout end |
#_render ⇒ Object
‘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 |
#params ⇒ Object
‘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 |