Class: ActionReporter::ActiveVersionReporter
- Inherits:
-
Base
- Object
- Base
- ActionReporter::ActiveVersionReporter
show all
- Defined in:
- lib/action_reporter/active_version_reporter.rb
Instance Method Summary
collapse
Methods inherited from Base
class_accessor, #merge_context_updates, #resolve_check_in_id, #resolve_user_id, #transaction_id=, #transaction_name=, #transform_context
Instance Method Details
#context(args) ⇒ Object
8
9
10
11
12
|
# File 'lib/action_reporter/active_version_reporter.rb', line 8
def context(args)
return unless ActiveVersion.respond_to?(:context=)
ActiveVersion.context = merge_context_updates(ActiveVersion.context, args)
end
|
#current_remote_addr ⇒ Object
38
39
40
|
# File 'lib/action_reporter/active_version_reporter.rb', line 38
def current_remote_addr
request_store_class&.remote_address
end
|
#current_remote_addr=(remote_addr) ⇒ Object
42
43
44
|
# File 'lib/action_reporter/active_version_reporter.rb', line 42
def current_remote_addr=(remote_addr)
request_store_class.remote_address = remote_addr if request_store_class&.respond_to?(:remote_address=)
end
|
#current_request_uuid ⇒ Object
30
31
32
|
# File 'lib/action_reporter/active_version_reporter.rb', line 30
def current_request_uuid
request_store_class&.request_uuid
end
|
#current_request_uuid=(request_uuid) ⇒ Object
34
35
36
|
# File 'lib/action_reporter/active_version_reporter.rb', line 34
def current_request_uuid=(request_uuid)
request_store_class.request_uuid = request_uuid if request_store_class&.respond_to?(:request_uuid=)
end
|
#current_user ⇒ Object
22
23
24
|
# File 'lib/action_reporter/active_version_reporter.rb', line 22
def current_user
request_store_class&.audited_user
end
|
#current_user=(user) ⇒ Object
26
27
28
|
# File 'lib/action_reporter/active_version_reporter.rb', line 26
def current_user=(user)
request_store_class.audited_user = user if request_store_class&.respond_to?(:audited_user=)
end
|
#notify ⇒ Object
5
6
|
# File 'lib/action_reporter/active_version_reporter.rb', line 5
def notify(*)
end
|
#reset_context ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/action_reporter/active_version_reporter.rb', line 14
def reset_context
request_store = request_store_class
request_store.request_uuid = nil if request_store&.respond_to?(:request_uuid=)
request_store.remote_address = nil if request_store&.respond_to?(:remote_address=)
request_store.audited_user = nil if request_store&.respond_to?(:audited_user=)
ActiveVersion.context = {} if ActiveVersion.respond_to?(:context=)
end
|