Class: Cerbos::Hub::Stores::Output::ModifyFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/cerbos/hub/stores/output/modify_files.rb

Overview

The outcome of modifying files in a store.

Instance Attribute Summary collapse

Instance Attribute Details

#changedBoolean (readonly)

Whether any changes were made to the store contents.

This can only be false if allow_unchanged was true.

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cerbos/hub/stores/output/modify_files.rb', line 10

ModifyFiles = Cerbos::Output.new_class(:new_store_version, :changed) do
  # @!attribute [r] new_store_version
  #   The new version of the store after the files were replaced.
  #
  #   If `allow_unchanged` was `true`, this will be the existing store version if no changes were made.
  #
  #   @return [Integer]

  # @!attribute [r] changed
  #   Whether any changes were made to the store contents.
  #
  #   This can only be `false` if `allow_unchanged` was `true`.
  #
  #   @return [Boolean]

  def self.from_protobuf(modify_files)
    new(
      new_store_version: modify_files.new_store_version,
      changed: true
    )
  end
end

#new_store_versionInteger (readonly)

The new version of the store after the files were replaced.

If allow_unchanged was true, this will be the existing store version if no changes were made.

Returns:

  • (Integer)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cerbos/hub/stores/output/modify_files.rb', line 10

ModifyFiles = Cerbos::Output.new_class(:new_store_version, :changed) do
  # @!attribute [r] new_store_version
  #   The new version of the store after the files were replaced.
  #
  #   If `allow_unchanged` was `true`, this will be the existing store version if no changes were made.
  #
  #   @return [Integer]

  # @!attribute [r] changed
  #   Whether any changes were made to the store contents.
  #
  #   This can only be `false` if `allow_unchanged` was `true`.
  #
  #   @return [Boolean]

  def self.from_protobuf(modify_files)
    new(
      new_store_version: modify_files.new_store_version,
      changed: true
    )
  end
end