Class: Serialization::Encrypted::Serializer
- Inherits:
-
Object
- Object
- Serialization::Encrypted::Serializer
- Defined in:
- lib/rswim/serialization/encrypted/serializer.rb
Instance Method Summary collapse
-
#initialize(directory) ⇒ Serializer
constructor
A new instance of Serializer.
- #serialize(message) ⇒ Object
Constructor Details
#initialize(directory) ⇒ Serializer
Returns a new instance of Serializer.
6 7 8 |
# File 'lib/rswim/serialization/encrypted/serializer.rb', line 6 def initialize(directory) @directory = directory end |
Instance Method Details
#serialize(message) ⇒ Object
10 11 12 13 14 |
# File 'lib/rswim/serialization/encrypted/serializer.rb', line 10 def serialize() unencrypted = serialize_unencrypted() cipher_text, salt = Encryption.encrypt(unencrypted).map { |s| Base64.encode64(s) } { message: cipher_text, salt: salt }.to_json end |