Class: InertiaRails::ScrollProp
- Includes:
- PropMergeable
- Defined in:
- lib/inertia_rails/scroll_prop.rb
Instance Attribute Summary
Attributes included from PropMergeable
#appends_at_paths, #match_on, #prepends_at_paths
Instance Method Summary collapse
- #call(controller) ⇒ Object
-
#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 |
# File 'lib/inertia_rails/scroll_prop.rb', line 9 def initialize(**, &block) super(&block) @merge = true @metadata = .delete(:metadata) @wrapper = .delete(:wrapper) @options = end |
Instance Method Details
#call(controller) ⇒ Object
19 20 21 22 23 |
# File 'lib/inertia_rails/scroll_prop.rb', line 19 def call(controller) @value = super configure_merge_intent(controller.request.headers['X-Inertia-Infinite-Scroll-Merge-Intent']) @value end |
#metadata ⇒ Object
25 26 27 |
# File 'lib/inertia_rails/scroll_prop.rb', line 25 def ScrollMetadata.extract(@metadata, **@options) end |