Class: LocomotiveGoogleSearch::Middlewares::CustomDrops

Inherits:
Object
  • Object
show all
Defined in:
lib/locomotive_google_search/middlewares/custom_drops.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ CustomDrops

Returns a new instance of CustomDrops.



10
11
12
# File 'lib/locomotive_google_search/middlewares/custom_drops.rb', line 10

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
# File 'lib/locomotive_google_search/middlewares/custom_drops.rb', line 14

def call(env)
  (env['steam.liquid_assigns'] ||= {}).tap do |assigns|
    assigns['google_search'] = LocomotiveGoogleSearch::Liquid::Drops::Search.new
  end
  @app.call(env)
end