Class: TCellAgent::Policies::HeadersPolicy
- Defined in:
- lib/tcell_agent/policies/headers_policy.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
Class Method Summary collapse
Instance Method Summary collapse
- #get_headers(tcell_context) ⇒ Object
-
#initialize(native_agent, enablements) ⇒ HeadersPolicy
constructor
A new instance of HeadersPolicy.
Constructor Details
#initialize(native_agent, enablements) ⇒ HeadersPolicy
Returns a new instance of HeadersPolicy.
12 13 14 15 |
# File 'lib/tcell_agent/policies/headers_policy.rb', line 12 def initialize(native_agent, enablements) @native_agent = native_agent @enabled = enablements['headers'] || false end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
10 11 12 |
# File 'lib/tcell_agent/policies/headers_policy.rb', line 10 def enabled @enabled end |
Class Method Details
.api_identifier ⇒ Object
6 7 8 |
# File 'lib/tcell_agent/policies/headers_policy.rb', line 6 def self.api_identifier 'headers' end |
Instance Method Details
#get_headers(tcell_context) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/tcell_agent/policies/headers_policy.rb', line 17 def get_headers(tcell_context) return [] unless @enabled response = @native_agent.get_headers(tcell_context) response['headers'] || [] end |