Module: Serket

Defined in:
lib/serket.rb,
lib/serket/version.rb,
lib/serket/configuration.rb,
lib/serket/field_decrypter.rb,
lib/serket/field_encrypter.rb,
lib/serket/decrypted_fields.rb,
lib/serket/encrypted_fields.rb

Defined Under Namespace

Modules: DecryptedFields, EncryptedFields Classes: Configuration, FieldDecrypter, FieldEncrypter

Constant Summary collapse

VERSION =
"0.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



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

def self.configuration
  @configuration ||= Configuration.new
end

Class Method Details

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

Yields:



17
18
19
# File 'lib/serket.rb', line 17

def self.configure
  yield(configuration)
end

.decrypt(cipher) ⇒ Object



25
26
27
# File 'lib/serket.rb', line 25

def self.decrypt(cipher)
  field_decrypter.decrypt(cipher)
end

.encrypt(text) ⇒ Object



21
22
23
# File 'lib/serket.rb', line 21

def self.encrypt(text)
  field_encrypter.encrypt(text)
end

.field_decrypterObject



33
34
35
# File 'lib/serket.rb', line 33

def self.field_decrypter
  @field_decrypter ||= FieldDecrypter.new
end

.field_encrypterObject



29
30
31
# File 'lib/serket.rb', line 29

def self.field_encrypter
  @field_encrypter ||= FieldEncrypter.new
end