Class: Mengpaneel::Strategy::CapableClientSide

Inherits:
Base
  • Object
show all
Defined in:
lib/mengpaneel/strategy/capable_client_side.rb

Constant Summary collapse

REQUEST_HEADER =
"X-Mengpaneel-Flush-Capable".freeze
RESPONSE_HEADER =
"X-Mengpaneel-Calls".freeze

Instance Attribute Summary

Attributes inherited from Base

#all_calls, #controller

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Mengpaneel::Strategy::Base

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/mengpaneel/strategy/capable_client_side.rb', line 11

def run
  return false unless controller
  return false unless capable?

  return true if all_calls[:tracking].blank?

  response.headers[RESPONSE_HEADER] = JSON.dump(all_calls[:tracking])

  true
end