Module: PhiAttrs

Defined in:
lib/phi_attrs/phi_record.rb,
lib/phi_attrs.rb,
lib/phi_attrs/logger.rb,
lib/phi_attrs/railtie.rb,
lib/phi_attrs/version.rb,
lib/phi_attrs/configure.rb,
lib/phi_attrs/formatter.rb,
lib/phi_attrs/exceptions.rb

Overview

Namespace for classes and modules that handle PHI Attribute Access Logging

Defined Under Namespace

Modules: Controller, Exceptions, Model, PhiRecord Classes: Formatter, Logger, Railtie

Constant Summary collapse

PHI_ACCESS_LOG_TAG =
'PHI Access Log'
VERSION =
'0.2.1'
FORMAT =
"%s %5s: %s\n"
@@log_path =
nil
@@current_user_method =
nil
@@translation_prefix =
'phi'

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (PhiAttrs)

    the object that the method was called on



8
9
10
# File 'lib/phi_attrs/configure.rb', line 8

def self.configure
  yield self if block_given?
end

.current_user_methodObject



28
29
30
# File 'lib/phi_attrs/configure.rb', line 28

def self.current_user_method
  @@current_user_method
end

.current_user_method=(value) ⇒ Object



32
33
34
# File 'lib/phi_attrs/configure.rb', line 32

def self.current_user_method=(value)
  @@current_user_method = value
end

.log_pathObject



12
13
14
# File 'lib/phi_attrs/configure.rb', line 12

def self.log_path
  @@log_path
end

.log_path=(value) ⇒ Object



16
17
18
# File 'lib/phi_attrs/configure.rb', line 16

def self.log_path=(value)
  @@log_path = value
end

.log_phi_access(user, message) ⇒ Object



16
17
18
19
20
# File 'lib/phi_attrs.rb', line 16

def self.log_phi_access(user, message)
  PhiAttrs::Logger.tagged(PHI_ACCESS_LOG_TAG, user) do
    PhiAttrs::Logger.info(message)
  end
end

.translation_prefixObject



20
21
22
# File 'lib/phi_attrs/configure.rb', line 20

def self.translation_prefix
  @@translation_prefix
end

.translation_prefix=(value) ⇒ Object



24
25
26
# File 'lib/phi_attrs/configure.rb', line 24

def self.translation_prefix=(value)
  @@translation_prefix = value
end