Class: Postnhost::PublicNavigationTargets

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/postnhost/public_navigation_targets.rb

Defined Under Namespace

Classes: Targets

Instance Method Summary collapse

Methods inherited from BaseService

call

Constructor Details

#initialize(items:, language:) ⇒ PublicNavigationTargets

Returns a new instance of PublicNavigationTargets.



5
6
7
8
# File 'app/services/postnhost/public_navigation_targets.rb', line 5

def initialize(items:, language:)
  @items = items
  @language = language
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
# File 'app/services/postnhost/public_navigation_targets.rb', line 10

def call
  records = {
    "article" => article_snapshots,
    "page" => page_snapshots,
    "category" => categories
  }

  success(Targets.new(records:, variants: variants_for(records)))
end