Class: InertiaRails::DeferProp

Inherits:
IgnoreOnFirstLoadProp show all
Includes:
PropCacheable, PropMergeable, PropOnceable
Defined in:
lib/inertia_rails/defer_prop.rb

Constant Summary collapse

DEFAULT_GROUP =
'default'

Instance Attribute Summary collapse

Attributes included from PropOnceable

#once_expires_in, #once_key

Attributes included from PropMergeable

#appends_at_paths, #match_on, #prepends_at_paths

Instance Method Summary collapse

Methods included from PropOnceable

#expires_at, #fresh?, #once?

Methods included from PropMergeable

#appends_at_root?, #deep_merge?, #merge?, #merges_at_root?, #prepends_at_root?

Methods included from PropCacheable

#cached?, #call

Methods inherited from BaseProp

#call

Constructor Details

#initialize(**props, &block) ⇒ DeferProp

Returns a new instance of DeferProp.



13
14
15
16
17
# File 'lib/inertia_rails/defer_prop.rb', line 13

def initialize(**props, &block)
  super(&block)

  @group = props[:group] || DEFAULT_GROUP
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



11
12
13
# File 'lib/inertia_rails/defer_prop.rb', line 11

def group
  @group
end

Instance Method Details

#deferred?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/inertia_rails/defer_prop.rb', line 19

def deferred?
  true
end