Class: TingYun::Agent::Transaction::Attributes
- Inherits:
-
Object
- Object
- TingYun::Agent::Transaction::Attributes
- Defined in:
- lib/ting_yun/agent/transaction/attributes.rb
Instance Attribute Summary collapse
-
#agent_attributes ⇒ Object
Returns the value of attribute agent_attributes.
-
#custom_params ⇒ Object
Returns the value of attribute custom_params.
-
#request_header ⇒ Object
Returns the value of attribute request_header.
-
#request_params ⇒ Object
Returns the value of attribute request_params.
-
#response_header ⇒ Object
Returns the value of attribute response_header.
-
#user_info ⇒ Object
Returns the value of attribute user_info.
Instance Method Summary collapse
-
#add_agent_attribute(key, value) ⇒ Object
no longer to care about the value if nil or not.
- #add_custom_params(key, value) ⇒ Object
- #add_request_params(key, value) ⇒ Object
- #add_user_info(key, value) ⇒ Object
-
#initialize ⇒ Attributes
constructor
A new instance of Attributes.
- #merge_request_header(hash) ⇒ Object
- #merge_request_parameters(hash) ⇒ Object
Constructor Details
#initialize ⇒ Attributes
Returns a new instance of Attributes.
9 10 11 12 13 14 15 16 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 9 def initialize @agent_attributes = {:httpStatus => 0} #defaul value @request_params = {} @custom_params = {:threadId => $$} @response_header = {} @request_header = {} @user_info = {} end |
Instance Attribute Details
#agent_attributes ⇒ Object
Returns the value of attribute agent_attributes.
8 9 10 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 8 def agent_attributes @agent_attributes end |
#custom_params ⇒ Object
Returns the value of attribute custom_params.
8 9 10 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 8 def custom_params @custom_params end |
#request_header ⇒ Object
Returns the value of attribute request_header.
8 9 10 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 8 def request_header @request_header end |
#request_params ⇒ Object
Returns the value of attribute request_params.
8 9 10 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 8 def request_params @request_params end |
#response_header ⇒ Object
Returns the value of attribute response_header.
8 9 10 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 8 def response_header @response_header end |
#user_info ⇒ Object
Returns the value of attribute user_info.
8 9 10 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 8 def user_info @user_info end |
Instance Method Details
#add_agent_attribute(key, value) ⇒ Object
no longer to care about the value if nil or not
19 20 21 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 19 def add_agent_attribute(key, value) @agent_attributes[key] = value end |
#add_custom_params(key, value) ⇒ Object
27 28 29 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 27 def add_custom_params(key, value) @custom_params[key] = value end |
#add_request_params(key, value) ⇒ Object
31 32 33 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 31 def add_request_params(key, value) @request_header[key] = value end |
#add_user_info(key, value) ⇒ Object
39 40 41 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 39 def add_user_info(key, value) @user_info[key] = value end |
#merge_request_header(hash) ⇒ Object
35 36 37 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 35 def merge_request_header(hash) @request_header.merge!(hash) if hash end |
#merge_request_parameters(hash) ⇒ Object
23 24 25 |
# File 'lib/ting_yun/agent/transaction/attributes.rb', line 23 def merge_request_parameters(hash) @request_params.merge!(hash) if hash end |