Class: Spree::CmsPages::Find

Inherits:
BaseFinder show all
Defined in:
app/finders/spree/cms_pages/find.rb

Constant Summary collapse

ALLOWED_KINDS =
%w[standard home feature].freeze

Instance Attribute Summary

Attributes inherited from BaseFinder

#params

Instance Method Summary collapse

Constructor Details

#initialize(scope:, params:) ⇒ Find

Returns a new instance of Find.



6
7
8
9
10
# File 'app/finders/spree/cms_pages/find.rb', line 6

def initialize(scope:, params:)
  @scope = scope
  @title = params.dig(:filter, :title)
  @kind  = params.dig(:filter, :type)
end

Instance Method Details

#executeObject



12
13
14
15
16
17
# File 'app/finders/spree/cms_pages/find.rb', line 12

def execute
  pages = by_title(scope)
  pages = by_kind(pages)

  pages
end