Class: Cerbos::Output::PlanResources::Expression
- Inherits:
-
Object
- Object
- Cerbos::Output::PlanResources::Expression
- Defined in:
- lib/cerbos/output/plan_resources.rb
Overview
An abstract syntax tree node representing an expression to evaluate.
Defined Under Namespace
Instance Attribute Summary collapse
-
#operands ⇒ Array<Expression, Value, Variable>
readonly
The operands on which to invoke the operator.
-
#operator ⇒ String
readonly
The operator to invoke.
Instance Attribute Details
#operands ⇒ Array<Expression, Value, Variable> (readonly)
The operands on which to invoke the operator.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cerbos/output/plan_resources.rb', line 73 PlanResources::Expression = Output.new_class(:operator, :operands) do # @!attribute [r] operator # The operator to invoke. # # @return [String] # @!attribute [r] operands # The operands on which to invoke the operator. # # @return [Array<Expression, Value, Variable>] def self.from_protobuf(expression) new( operator: expression.operator, operands: (expression.operands || []).map { |operand| PlanResources::Expression::Operand.from_protobuf(operand) } ) end end |
#operator ⇒ String (readonly)
The operator to invoke.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cerbos/output/plan_resources.rb', line 73 PlanResources::Expression = Output.new_class(:operator, :operands) do # @!attribute [r] operator # The operator to invoke. # # @return [String] # @!attribute [r] operands # The operands on which to invoke the operator. # # @return [Array<Expression, Value, Variable>] def self.from_protobuf(expression) new( operator: expression.operator, operands: (expression.operands || []).map { |operand| PlanResources::Expression::Operand.from_protobuf(operand) } ) end end |