Class: Google::Cloud::Storage::Policy::Condition
- Inherits:
-
Object
- Object
- Google::Cloud::Storage::Policy::Condition
- Defined in:
- lib/google/cloud/storage/policy/condition.rb
Overview
Condition
Value object accepting an attribute-based logic expression based on a subset of the Common Expression Language (CEL).
Instance Attribute Summary collapse
-
#description ⇒ String
Used to document the condition.
-
#expression ⇒ String
Defines an attribute-based logic expression using a subset of the Common Expression Language (CEL).
-
#title ⇒ String
Used to identify the condition.
Instance Method Summary collapse
-
#initialize(title:, description: nil, expression:) ⇒ Condition
constructor
Creates a Condition object.
- #to_gapi ⇒ Object
Constructor Details
#initialize(title:, description: nil, expression:) ⇒ Condition
Creates a Condition object.
86 87 88 89 90 |
# File 'lib/google/cloud/storage/policy/condition.rb', line 86 def initialize title:, description: nil, expression: @title = String title @description = String description @expression = String expression end |
Instance Attribute Details
#description ⇒ String
Used to document the condition. Optional.
72 73 74 |
# File 'lib/google/cloud/storage/policy/condition.rb', line 72 def description @description end |
#expression ⇒ String
Defines an attribute-based logic expression using a subset of the Common Expression Language (CEL). The condition expression can contain multiple statements, each uses one attributes, and statements are combined using logic operators, following CEL language specification. Required.
72 73 74 |
# File 'lib/google/cloud/storage/policy/condition.rb', line 72 def expression @expression end |
#title ⇒ String
Used to identify the condition. Required.
72 73 74 |
# File 'lib/google/cloud/storage/policy/condition.rb', line 72 def title @title end |
Instance Method Details
#to_gapi ⇒ Object
125 126 127 128 129 130 131 |
# File 'lib/google/cloud/storage/policy/condition.rb', line 125 def to_gapi { title: @title, description: @description, expression: @expression }.delete_if { |_, v| v.nil? } end |