Class: InertiaRails::BaseProp

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

Overview

Base class for all props.

Direct Known Subclasses

AlwaysProp, IgnoreOnFirstLoadProp, MergeProp

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ BaseProp

Returns a new instance of BaseProp.



6
7
8
# File 'lib/inertia_rails/base_prop.rb', line 6

def initialize(&block)
  @block = block
end

Instance Method Details

#call(controller) ⇒ Object



10
11
12
# File 'lib/inertia_rails/base_prop.rb', line 10

def call(controller)
  controller.instance_exec(&@block)
end