Class: MuchRails::Action::RenderResult
- Inherits:
-
BaseResult
- Object
- BaseResult
- MuchRails::Action::RenderResult
- Defined in:
- lib/much-rails/action/render_result.rb
Overview
MuchRails::Action::RenderResult is a result returned by calling a view action that directs the controller to render a response.
Instance Attribute Summary collapse
-
#render_kargs ⇒ Object
readonly
Returns the value of attribute render_kargs.
-
#render_view_model ⇒ Object
readonly
Returns the value of attribute render_view_model.
Instance Method Summary collapse
-
#execute_block ⇒ Object
This block is called using ‘instance_exec` in the scope of the controller.
-
#initialize(render_view_model, **render_kargs) ⇒ RenderResult
constructor
A new instance of RenderResult.
Constructor Details
#initialize(render_view_model, **render_kargs) ⇒ RenderResult
Returns a new instance of RenderResult.
13 14 15 16 |
# File 'lib/much-rails/action/render_result.rb', line 13 def initialize(render_view_model, **render_kargs) @render_view_model = render_view_model @render_kargs = render_kargs end |
Instance Attribute Details
#render_kargs ⇒ Object (readonly)
Returns the value of attribute render_kargs.
11 12 13 |
# File 'lib/much-rails/action/render_result.rb', line 11 def render_kargs @render_kargs end |
#render_view_model ⇒ Object (readonly)
Returns the value of attribute render_view_model.
11 12 13 |
# File 'lib/much-rails/action/render_result.rb', line 11 def render_view_model @render_view_model end |
Instance Method Details
#execute_block ⇒ Object
This block is called using ‘instance_exec` in the scope of the controller
19 20 21 22 23 24 |
# File 'lib/much-rails/action/render_result.rb', line 19 def execute_block ->(result){ @view = result.render_view_model render(**result.render_kargs) } end |