Class: CryptReboot::CryptTab::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/crypt_reboot/crypt_tab/entry.rb

Overview

Value-object describing entry in crypttab file

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#flagsObject (readonly)

Returns the value of attribute flags.



7
8
9
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 7

def flags
  @flags
end

#key_fileObject (readonly)

Returns the value of attribute key_file.



7
8
9
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 7

def key_file
  @key_file
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 7

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



7
8
9
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 7

def source
  @source
end

#targetObject (readonly)

Returns the value of attribute target.



7
8
9
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 7

def target
  @target
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
12
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 9

def ==(other)
  target == other.target && source == other.source && key_file == other.key_file &&
    options == other.options && flags.sort == other.flags.sort
end

#headevice(header_prefix: nil) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/crypt_reboot/crypt_tab/entry.rb', line 14

def headevice(header_prefix: nil)
  if header_prefix && header_path
    File.join(header_prefix, header_path)
  elsif header_path
    header_path
  else
    source
  end
end