Module: Legion::Compliance::PhiTag

Defined in:
lib/legion/compliance/phi_tag.rb

Class Method Summary collapse

Class Method Details

.phi?(metadata) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/legion/compliance/phi_tag.rb', line 7

def phi?()
  return false unless Legion::Compliance.phi_enabled?
  return false unless .is_a?(Hash)

  [:phi] == true
end

.tag(metadata) ⇒ Object



14
15
16
17
# File 'lib/legion/compliance/phi_tag.rb', line 14

def tag()
  base = .is_a?(Hash) ?  : {}
  base.merge(phi: true, data_classification: 'restricted')
end

.tagged_cache_key(key) ⇒ Object



19
20
21
22
23
24
# File 'lib/legion/compliance/phi_tag.rb', line 19

def tagged_cache_key(key)
  str = key.to_s
  return str if str.start_with?('phi:')

  "phi:#{str}"
end