Sha256: 7f78162bc84135b4fe692d42954ff37bb97d427afd1bc757c6ee35e37c196a12

Contents?: true

Size: 716 Bytes

Versions: 18

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

require "much-rails/action/base_result"

module MuchRails; end
module MuchRails::Action; end

# MuchRails::Action::RenderResult is a result returned by calling a view
# action that directs the controller to render a response.
class MuchRails::Action::RenderResult < MuchRails::Action::BaseResult
  attr_reader :render_view_model, :render_kargs

  def initialize(render_view_model, **render_kargs)
    @render_view_model = render_view_model
    @render_kargs = render_kargs
  end

  # This block is called using `instance_exec` in the scope of the controller
  def execute_block
    ->(result){
      @view = result.render_view_model
      render(**result.render_kargs)
    }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
much-rails-0.4.3 lib/much-rails/action/render_result.rb
much-rails-0.4.2 lib/much-rails/action/render_result.rb
much-rails-0.4.1 lib/much-rails/action/render_result.rb
much-rails-0.4.0 lib/much-rails/action/render_result.rb
much-rails-0.3.0 lib/much-rails/action/render_result.rb
much-rails-0.2.8 lib/much-rails/action/render_result.rb
much-rails-0.2.7 lib/much-rails/action/render_result.rb
much-rails-0.2.6 lib/much-rails/action/render_result.rb
much-rails-0.2.5 lib/much-rails/action/render_result.rb
much-rails-0.2.4 lib/much-rails/action/render_result.rb
much-rails-0.2.3 lib/much-rails/action/render_result.rb
much-rails-0.2.2 lib/much-rails/action/render_result.rb
much-rails-0.2.1 lib/much-rails/action/render_result.rb
much-rails-0.2.0 lib/much-rails/action/render_result.rb
much-rails-0.1.3 lib/much-rails/action/render_result.rb
much-rails-0.1.2 lib/much-rails/action/render_result.rb
much-rails-0.1.1 lib/much-rails/action/render_result.rb
much-rails-0.1.0 lib/much-rails/action/render_result.rb