Class: InertiaRails::ScrollProp
- Includes:
- PropMergeable
- Defined in:
- lib/inertia_rails/scroll_prop.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
Attributes included from PropMergeable
#appends_at_paths, #match_on, #prepends_at_paths
Instance Method Summary collapse
- #call(controller, scroll_intent: nil) ⇒ Object
- #deferred? ⇒ Boolean
-
#initialize(**options, &block) ⇒ ScrollProp
constructor
A new instance of ScrollProp.
- #metadata ⇒ Object
Methods included from PropMergeable
#appends_at_root?, #deep_merge?, #merge?, #merges_at_root?, #prepends_at_root?
Constructor Details
#initialize(**options, &block) ⇒ ScrollProp
Returns a new instance of ScrollProp.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/inertia_rails/scroll_prop.rb', line 9 def initialize(**, &block) super(&block) @merge = true @deferred = .delete(:defer) || false @group = .delete(:group) || DeferProp::DEFAULT_GROUP @metadata = .delete(:metadata) @wrapper = .delete(:wrapper) @options = end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
7 8 9 |
# File 'lib/inertia_rails/scroll_prop.rb', line 7 def group @group end |
Instance Method Details
#call(controller, scroll_intent: nil) ⇒ Object
25 26 27 28 29 |
# File 'lib/inertia_rails/scroll_prop.rb', line 25 def call(controller, scroll_intent: nil, **) @value = super(controller) configure_merge_intent(scroll_intent) @value end |
#deferred? ⇒ Boolean
21 22 23 |
# File 'lib/inertia_rails/scroll_prop.rb', line 21 def deferred? @deferred end |
#metadata ⇒ Object
31 32 33 |
# File 'lib/inertia_rails/scroll_prop.rb', line 31 def ScrollMetadata.extract(@metadata, **@options) end |