Class: Cerbos::Hub::Stores::Output::GetFiles

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

Overview

The outcome of getting files from a store.

See Also:

Instance Attribute Summary collapse

Instance Attribute Details

#filesArray<File> (readonly)

Paths of the files that were found in the store.

Returns:



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

GetFiles = Cerbos::Output.new_class(:store_version, :files) do
  # @!attribute [r] store_version
  #   The current version of the store.
  #
  #   @return [Integer]

  # @!attribute [r] files
  #   Paths of the files that were found in the store.
  #
  #   @return [Array<File>]

  def self.from_protobuf(get_files)
    new(
      store_version: get_files.store_version,
      files: get_files.files.map { |file| File.from_protobuf(file) }
    )
  end
end

#store_versionInteger (readonly)

The current version of the store.

Returns:

  • (Integer)


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

GetFiles = Cerbos::Output.new_class(:store_version, :files) do
  # @!attribute [r] store_version
  #   The current version of the store.
  #
  #   @return [Integer]

  # @!attribute [r] files
  #   Paths of the files that were found in the store.
  #
  #   @return [Array<File>]

  def self.from_protobuf(get_files)
    new(
      store_version: get_files.store_version,
      files: get_files.files.map { |file| File.from_protobuf(file) }
    )
  end
end