Class: InertiaRails::ScrollMetadata::HashAdapter

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

Instance Method Summary collapse

Instance Method Details

#call(metadata, **_options) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/inertia_rails/scroll_metadata.rb', line 61

def call(, **_options)
  {
    page_name: .fetch(:page_name),
    previous_page: .fetch(:previous_page),
    next_page: .fetch(:next_page),
    current_page: .fetch(:current_page),
  }
end

#match?(metadata) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/inertia_rails/scroll_metadata.rb', line 57

def match?()
  .is_a?(Hash)
end