Class: Google::Cloud::Bigquery::Condition
- Inherits:
-
Object
- Object
- Google::Cloud::Bigquery::Condition
- Defined in:
- lib/google/cloud/bigquery/condition.rb
Overview
Condition
Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Used to define condition for Dataset::Access rules
Instance Method Summary collapse
-
#description ⇒ String?
Returns the optional description of the expression.
-
#description=(val) ⇒ Object
Sets the optional description of the expression.
-
#expression ⇒ String
Returns the textual representation of an expression in Common Expression Language syntax.
-
#expression=(val) ⇒ Object
Sets the textual representation of an expression in Common Expression Language syntax.
-
#initialize(expression, description: nil, location: nil, title: nil) ⇒ Condition
constructor
Create a new Condition object.
-
#location ⇒ String?
Returns the optional string indicating the location of the expression for error reporting, e.g.
-
#location=(val) ⇒ Object
Sets the optional string indicating the location of the expression for error reporting, e.g.
-
#title ⇒ String?
Returns the optional title for the expression, i.e.
-
#title=(val) ⇒ Object
Sets the optional title for the expression, i.e.
Constructor Details
#initialize(expression, description: nil, location: nil, title: nil) ⇒ Condition
Create a new Condition object.
184 185 186 187 188 189 190 191 192 |
# File 'lib/google/cloud/bigquery/condition.rb', line 184 def initialize expression, description: nil, location: nil, title: nil if expression.nil? || expression.strip.empty? raise ArgumentError, "Expression cannot be nil or empty" end @expression = expression @description = description @location = location @title = title end |
Instance Method Details
#description ⇒ String?
Returns the optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
78 79 80 |
# File 'lib/google/cloud/bigquery/condition.rb', line 78 def description @description end |
#description=(val) ⇒ Object
Sets the optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
94 95 96 |
# File 'lib/google/cloud/bigquery/condition.rb', line 94 def description= val @description = val end |
#expression ⇒ String
Returns the textual representation of an expression in Common Expression Language syntax.
41 42 43 |
# File 'lib/google/cloud/bigquery/condition.rb', line 41 def expression @expression end |
#expression=(val) ⇒ Object
Sets the textual representation of an expression in Common Expression Language syntax.
58 59 60 61 62 63 |
# File 'lib/google/cloud/bigquery/condition.rb', line 58 def expression= val if val.nil? || val.strip.empty? raise ArgumentError, "Expression cannot be nil or empty" end @expression = val end |
#location ⇒ String?
Returns the optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
111 112 113 |
# File 'lib/google/cloud/bigquery/condition.rb', line 111 def location @location end |
#location=(val) ⇒ Object
Sets the optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
127 128 129 |
# File 'lib/google/cloud/bigquery/condition.rb', line 127 def location= val @location = val end |
#title ⇒ String?
Returns the optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
144 145 146 |
# File 'lib/google/cloud/bigquery/condition.rb', line 144 def title @title end |
#title=(val) ⇒ Object
Sets the optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
160 161 162 |
# File 'lib/google/cloud/bigquery/condition.rb', line 160 def title= val @title = val end |