Class: Storage::Algolia::Actions::All

Inherits:
Base show all
Defined in:
lib/storage/algolia/actions/all.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationService

process

Constructor Details

#initialize(model_name:, cursor: nil) ⇒ All

Returns a new instance of All.



11
12
13
14
# File 'lib/storage/algolia/actions/all.rb', line 11

def initialize(model_name:, cursor: nil)
  @model_name = model_name
  @cursor = cursor
end

Instance Attribute Details

#cursorObject (readonly)

Returns the value of attribute cursor.



9
10
11
# File 'lib/storage/algolia/actions/all.rb', line 9

def cursor
  @cursor
end

#model_nameObject (readonly)

Returns the value of attribute model_name.



9
10
11
# File 'lib/storage/algolia/actions/all.rb', line 9

def model_name
  @model_name
end

Instance Method Details

#metaObject



20
21
22
# File 'lib/storage/algolia/actions/all.rb', line 20

def meta
  query.except!('hits').to_hashugar
end

#processObject



16
17
18
# File 'lib/storage/algolia/actions/all.rb', line 16

def process
  normalize query.dig('hits')
end