Class: CryptReboot::CryptTab::EntryDeserializer
- Inherits:
-
Object
- Object
- CryptReboot::CryptTab::EntryDeserializer
- Defined in:
- lib/crypt_reboot/crypt_tab/entry_deserializer.rb
Overview
Deserialize crypttab line into value object
Constant Summary collapse
- InvalidFormat =
Class.new StandardError
Instance Method Summary collapse
Instance Method Details
#call(line) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/crypt_reboot/crypt_tab/entry_deserializer.rb', line 9 def call(line) target, source, key_file, = columns = line.split raise InvalidFormat if columns.size < 3 = .to_s.split(',') flags = extract_flags() = () entry_class.new( target: target, source: source, key_file: key_file, options: , flags: flags ) end |