Class: Kingdom::Box
- Inherits:
-
Object
- Object
- Kingdom::Box
- Defined in:
- lib/kingdom/box.rb
Instance Method Summary collapse
- #<<(i) ⇒ Object
- #[](i) ⇒ Object
- #decrypt(c) ⇒ Object
- #encrypt(s) ⇒ Object
-
#initialize(k) ⇒ Box
constructor
A new instance of Box.
Constructor Details
#initialize(k) ⇒ Box
Returns a new instance of Box.
23 24 25 |
# File 'lib/kingdom/box.rb', line 23 def initialize k @key = OpenSSL::Digest::SHA256.digest(k) end |
Instance Method Details
#<<(i) ⇒ Object
34 35 36 |
# File 'lib/kingdom/box.rb', line 34 def << i encrypt(i) end |
#[](i) ⇒ Object
47 48 49 |
# File 'lib/kingdom/box.rb', line 47 def [] i decrypt(i) end |