Class: Cerbos::Hub::Stores::File
- Inherits:
-
Object
- Object
- Cerbos::Hub::Stores::File
- Defined in:
- lib/cerbos/hub/stores/file.rb
Overview
A file in a store.
Instance Attribute Summary collapse
-
#contents ⇒ String
readonly
The contents of the file (with binary encoding).
-
#path ⇒ String
readonly
The path of the file.
Instance Attribute Details
#contents ⇒ String (readonly)
The contents of the file (with binary encoding).
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cerbos/hub/stores/file.rb', line 7 File = Output.new_class(:path, :contents) do # @!attribute [r] path # The path of the file. # # @return [String] # @!attribute [r] contents # The contents of the file (with binary encoding). # # @return [String] def self.from_protobuf(file) new(path: file.path, contents: file.contents) end # @private def to_protobuf Protobuf::Cerbos::Cloud::Store::V1::File.new(path:, contents:) end end |
#path ⇒ String (readonly)
The path of the file.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cerbos/hub/stores/file.rb', line 7 File = Output.new_class(:path, :contents) do # @!attribute [r] path # The path of the file. # # @return [String] # @!attribute [r] contents # The contents of the file (with binary encoding). # # @return [String] def self.from_protobuf(file) new(path: file.path, contents: file.contents) end # @private def to_protobuf Protobuf::Cerbos::Cloud::Store::V1::File.new(path:, contents:) end end |