Class: InertiaRails::RSpec::InertiaRenderWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/inertia_rails/rspec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInertiaRenderWrapper

Returns a new instance of InertiaRenderWrapper.



9
10
11
12
13
# File 'lib/inertia_rails/rspec.rb', line 9

def initialize
  @view_data = nil
  @props = nil
  @component = nil
end

Instance Attribute Details

#componentObject (readonly)

Returns the value of attribute component.



7
8
9
# File 'lib/inertia_rails/rspec.rb', line 7

def component
  @component
end

#propsObject (readonly)

Returns the value of attribute props.



7
8
9
# File 'lib/inertia_rails/rspec.rb', line 7

def props
  @props
end

#view_dataObject (readonly)

Returns the value of attribute view_data.



7
8
9
# File 'lib/inertia_rails/rspec.rb', line 7

def view_data
  @view_data
end

Instance Method Details

#call(params) ⇒ Object



15
16
17
18
# File 'lib/inertia_rails/rspec.rb', line 15

def call(params)
  set_values(params)
  @render_method&.call(params)
end

#wrap_render(render_method) ⇒ Object



20
21
22
23
# File 'lib/inertia_rails/rspec.rb', line 20

def wrap_render(render_method)
  @render_method = render_method
  self
end