Class: AttrMasker::Maskers::Simple

Inherits:
Object
  • Object
show all
Defined in:
lib/attr_masker/maskers/simple.rb

Overview

Simple masker replaces values with a predefined (redacted) string. This is a default masker, which is used when no specific :masker is passed in attr_masker method call.

Examples:

Would mask “Adam West” as “(redacted)”

class User < ActiveRecord::Base
  m = AttrMasker::Maskers::Simple.new
  attr_masker :name, :masker => m
end

Would mask “Adam West” as “(redacted)”

class User < ActiveRecord::Base
  attr_masker :name
end

Instance Method Summary collapse

Instance Method Details

#call(**_opts) ⇒ Object

Accepts any keyword arguments, but they all are ignored.



22
23
24
# File 'lib/attr_masker/maskers/simple.rb', line 22

def call(**_opts)
  "(redacted)"
end