Module: EncryptAttr::Base

Defined in:
lib/encrypt_attr/base.rb

Defined Under Namespace

Modules: ClassMethods

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.encryptorObject

Define the object that will encrypt/decrypt values. By default, it’s EncryptAttr::Encryptor



10
11
12
# File 'lib/encrypt_attr/base.rb', line 10

def encryptor
  @encryptor
end

Class Method Details

.included(target) ⇒ Object



3
4
5
# File 'lib/encrypt_attr/base.rb', line 3

def self.included(target)
  target.extend(ClassMethods)
end

.secret_tokenObject



13
14
15
# File 'lib/encrypt_attr/base.rb', line 13

def self.secret_token
  @secret_token
end

.secret_token=(secret_token) ⇒ Object



17
18
19
20
# File 'lib/encrypt_attr/base.rb', line 17

def self.secret_token=(secret_token)
  encryptor.validate_secret_token(secret_token.to_s) if encryptor.respond_to?(:validate_secret_token)
  @secret_token = secret_token.to_s
end