Module: QuoVadis::IpMasking

Included in:
Log, Session
Defined in:
lib/quo_vadis/ip_masking.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
# File 'lib/quo_vadis/ip_masking.rb', line 8

def self.included(base)
  base.extend ClassMethods
  base.before_validation :mask_ip, if: -> { QuoVadis.mask_ips }
end

Instance Method Details

#mask_ipObject



13
14
15
# File 'lib/quo_vadis/ip_masking.rb', line 13

def mask_ip
  self.ip = self.class.mask_ip ip
end