Class: ActionReporter::AuditedReporter

Inherits:
Base
  • Object
show all
Defined in:
lib/action_reporter/audited_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/audited_reporter.rb', line 8

def context(args)
  return unless Audited.respond_to?(:context=)

  Audited.context = merge_context_updates(Audited.context, args)
end

#current_remote_addrObject



37
38
39
# File 'lib/action_reporter/audited_reporter.rb', line 37

def current_remote_addr
  Audited.store[:current_remote_address]
end

#current_remote_addr=(remote_addr) ⇒ Object



41
42
43
# File 'lib/action_reporter/audited_reporter.rb', line 41

def current_remote_addr=(remote_addr)
  Audited.store[:current_remote_address] = remote_addr
end

#current_request_uuidObject



29
30
31
# File 'lib/action_reporter/audited_reporter.rb', line 29

def current_request_uuid
  Audited.store[:current_request_uuid]
end

#current_request_uuid=(request_uuid) ⇒ Object



33
34
35
# File 'lib/action_reporter/audited_reporter.rb', line 33

def current_request_uuid=(request_uuid)
  Audited.store[:current_request_uuid] = request_uuid
end

#current_userObject



21
22
23
# File 'lib/action_reporter/audited_reporter.rb', line 21

def current_user
  Audited.store[:audited_user]
end

#current_user=(user) ⇒ Object



25
26
27
# File 'lib/action_reporter/audited_reporter.rb', line 25

def current_user=(user)
  Audited.store[:audited_user] = user
end

#notifyObject



5
6
# File 'lib/action_reporter/audited_reporter.rb', line 5

def notify(*)
end

#reset_contextObject



14
15
16
17
18
19
# File 'lib/action_reporter/audited_reporter.rb', line 14

def reset_context
  Audited.store.delete(:current_remote_address)
  Audited.store.delete(:current_request_uuid)
  Audited.store.delete(:audited_user)
  Audited.context = {} if Audited.respond_to?(:context=)
end