Class: Ruby::Rego::AST::QueryLiteral

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby/rego/ast/query.rb

Overview

Represents a query literal with optional with modifiers.

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods inherited from Base

#==, #accept, #deconstruct_keys, #eql?, format_value, #hash, #to_s

Constructor Details

#initialize(expression:, with_modifiers: [], location: nil) ⇒ QueryLiteral

Returns a new instance of QueryLiteral.

Parameters:

  • expression (Object)
  • with_modifiers (Array<WithModifier>) (defaults to: [])
  • location (Location, nil) (defaults to: nil)


13
14
15
16
17
# File 'lib/ruby/rego/ast/query.rb', line 13

def initialize(expression:, with_modifiers: [], location: nil)
  super(location: location)
  @expression = expression
  @with_modifiers = with_modifiers.dup.freeze
end

Instance Attribute Details

#expressionObject (readonly)

Returns:

  • (Object)


20
21
22
# File 'lib/ruby/rego/ast/query.rb', line 20

def expression
  @expression
end

#with_modifiersArray<WithModifier> (readonly)

Returns:



23
24
25
# File 'lib/ruby/rego/ast/query.rb', line 23

def with_modifiers
  @with_modifiers
end