Class: Enveloperb::EncryptedRecord
- Inherits:
-
Object
- Object
- Enveloperb::EncryptedRecord
- Defined in:
- lib/enveloperb/encrypted_record.rb
Overview
An envelope encrypted record.
Class Method Summary collapse
-
.new(s) ⇒ Object
Create an encrypted record from a serialized form.
Instance Method Summary collapse
-
#to_s ⇒ String
Serialize an encrypted record into a string.
Class Method Details
.new(s) ⇒ Object
Create an encrypted record from a serialized form.
Encrypted records can be serialized (using #to_s), and then deserialized by passing them into this constructor.
13 14 15 16 17 18 19 |
# File 'lib/enveloperb/encrypted_record.rb', line 13 def self.new(s) unless s.is_a?(String) && s.encoding == Encoding::BINARY raise ArgumentError, "Serialized encrypted record must be a binary string" end _new(s) end |
Instance Method Details
#to_s ⇒ String
Serialize an encrypted record into a string.
27 28 29 |
# File 'lib/enveloperb/encrypted_record.rb', line 27 def to_s _serialize end |