Class: Params::Crypter
- Inherits:
-
Object
- Object
- Params::Crypter
- Includes:
- Singleton
- Defined in:
- lib/params/crypter.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
writeonly
Sets the attribute password.
Class Method Summary collapse
- .off! ⇒ Object
- .off? ⇒ Boolean
- .on! ⇒ Object
- .on? ⇒ Boolean
- .password ⇒ Object
- .password=(pass) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#password=(value) ⇒ Object
Sets the attribute password
34 35 36 |
# File 'lib/params/crypter.rb', line 34 def password=(value) @password = value end |
Class Method Details
.off! ⇒ Object
13 14 15 |
# File 'lib/params/crypter.rb', line 13 def off! @on = false end |
.off? ⇒ Boolean
21 22 23 |
# File 'lib/params/crypter.rb', line 21 def off? !on? end |
.on! ⇒ Object
9 10 11 |
# File 'lib/params/crypter.rb', line 9 def on! @on = true end |
.on? ⇒ Boolean
17 18 19 |
# File 'lib/params/crypter.rb', line 17 def on? !(@on == false) end |
Instance Method Details
#decrypt(data) ⇒ Object
49 50 51 52 |
# File 'lib/params/crypter.rb', line 49 def decrypt data return data if off? cipher.dec data end |
#encrypt(data) ⇒ Object
44 45 46 47 |
# File 'lib/params/crypter.rb', line 44 def encrypt data return data if off? cipher.enc data end |