Class: RKSeal::Commands::EditLocal::LocalPlan

Inherits:
Struct
  • Object
show all
Defined in:
lib/rkseal/commands/edit_local.rb

Overview

The classified result of one local-edit buffer: which keys to reseal (from plaintext stringData or verbatim base64 data), which to remove, and whether the template type changed. Kept keys are absent by construction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#removed_keysObject

Returns the value of attribute removed_keys

Returns:

  • (Object)

    the current value of removed_keys



113
114
115
# File 'lib/rkseal/commands/edit_local.rb', line 113

def removed_keys
  @removed_keys
end

#reseal_dataObject

Returns the value of attribute reseal_data

Returns:

  • (Object)

    the current value of reseal_data



113
114
115
# File 'lib/rkseal/commands/edit_local.rb', line 113

def reseal_data
  @reseal_data
end

#reseal_string_dataObject

Returns the value of attribute reseal_string_data

Returns:

  • (Object)

    the current value of reseal_string_data



113
114
115
# File 'lib/rkseal/commands/edit_local.rb', line 113

def reseal_string_data
  @reseal_string_data
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



113
114
115
# File 'lib/rkseal/commands/edit_local.rb', line 113

def type
  @type
end

#type_changedObject

Returns the value of attribute type_changed

Returns:

  • (Object)

    the current value of type_changed



113
114
115
# File 'lib/rkseal/commands/edit_local.rb', line 113

def type_changed
  @type_changed
end

Instance Method Details

#changes?Boolean

Returns whether the buffer changed anything at all.

Returns:

  • (Boolean)

    whether the buffer changed anything at all.



123
124
125
# File 'lib/rkseal/commands/edit_local.rb', line 123

def changes?
  reseal? || removed_keys.any? || type_changed
end

#reseal?Boolean

Returns whether any key must be (re)sealed.

Returns:

  • (Boolean)

    whether any key must be (re)sealed.



118
119
120
# File 'lib/rkseal/commands/edit_local.rb', line 118

def reseal?
  !reseal_string_data.empty? || !reseal_data.empty?
end