Class: InertiaFlow::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/inertia_flow/renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component, options, controller, request, response) ⇒ Renderer

Returns a new instance of Renderer.



9
10
11
12
13
14
15
# File 'lib/inertia_flow/renderer.rb', line 9

def initialize(component, options, controller, request, response)
  @component = component
  @options = options
  @controller = controller
  @request = request
  @response = response
end

Instance Attribute Details

#componentObject

Returns the value of attribute component.



7
8
9
# File 'lib/inertia_flow/renderer.rb', line 7

def component
  @component
end

#controllerObject

Returns the value of attribute controller.



7
8
9
# File 'lib/inertia_flow/renderer.rb', line 7

def controller
  @controller
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/inertia_flow/renderer.rb', line 7

def options
  @options
end

#requestObject

Returns the value of attribute request.



7
8
9
# File 'lib/inertia_flow/renderer.rb', line 7

def request
  @request
end

#responseObject

Returns the value of attribute response.



7
8
9
# File 'lib/inertia_flow/renderer.rb', line 7

def response
  @response
end

Instance Method Details

#renderObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/inertia_flow/renderer.rb', line 17

def render
  props = jbuilder_attributes

  InertiaRails::Renderer.new(
    component,
    controller,
    request,
    response,
    render_method,
    props: props,
    view_data: options[:view_data]
  ).render
end