Module: HasEncryptedField

Extended by:
ActiveSupport::Concern
Defined in:
lib/has_encrypted_field.rb,
lib/has_encrypted_field/version.rb,
lib/has_encrypted_field/accessors.rb,
lib/has_encrypted_field/configuration.rb,
lib/has_encrypted_field/query_methods.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods Classes: Configuration

Constant Summary collapse

VERSION =
"0.3.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



18
19
20
# File 'lib/has_encrypted_field.rb', line 18

def configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



22
23
24
# File 'lib/has_encrypted_field.rb', line 22

def configure
  yield(configuration)
end

.encryptorObject



14
15
16
# File 'lib/has_encrypted_field.rb', line 14

def encryptor
  @encryptor ||= ActiveSupport::MessageEncryptor.new(configuration.secret_key)
end

.register(class_name, field) ⇒ Object



30
31
32
33
# File 'lib/has_encrypted_field.rb', line 30

def register(class_name, field)
  registered_fields[class_name] ||= []
  registered_fields[class_name] << field
end

.registered_fieldsObject



26
27
28
# File 'lib/has_encrypted_field.rb', line 26

def registered_fields
  @registered_fields ||= {}
end