Class: Cerbos::Output::CheckResources::Result::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/cerbos/output/check_resources.rb

Overview

User-defined output from a policy rule evaluation.

Instance Attribute Summary collapse

Instance Attribute Details

#sourceString (readonly)

The identifier of the policy rule that produced the output.

Returns:

  • (String)


236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/cerbos/output/check_resources.rb', line 236

CheckResources::Result::Output = Output.new_class(:source, :value) do
  # @!attribute [r] source
  #   The identifier of the policy rule that produced the output.
  #
  #   @return [String]

  # @!attribute [r] value
  #   The result of evaluating the output expression.
  #
  #   @return [String, Numeric, Boolean, Array, Hash, nil]

  def self.from_protobuf(output_entry)
    new(
      source: output_entry.src,
      value: output_entry.val&.to_ruby(true)
    )
  end
end

#valueString, ... (readonly)

The result of evaluating the output expression.

Returns:

  • (String, Numeric, Boolean, Array, Hash, nil)


236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/cerbos/output/check_resources.rb', line 236

CheckResources::Result::Output = Output.new_class(:source, :value) do
  # @!attribute [r] source
  #   The identifier of the policy rule that produced the output.
  #
  #   @return [String]

  # @!attribute [r] value
  #   The result of evaluating the output expression.
  #
  #   @return [String, Numeric, Boolean, Array, Hash, nil]

  def self.from_protobuf(output_entry)
    new(
      source: output_entry.src,
      value: output_entry.val&.to_ruby(true)
    )
  end
end