Class: Ruby::Rego::AST::SomeDecl

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

Overview

Represents a some declaration.

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(variables:, collection: nil, location: nil) ⇒ SomeDecl

Returns a new instance of SomeDecl.

Parameters:

  • variables (Array<Variable>)
  • collection (Object, nil) (defaults to: nil)
  • location (Location, nil) (defaults to: nil)


31
32
33
34
35
# File 'lib/ruby/rego/ast/query.rb', line 31

def initialize(variables:, collection: nil, location: nil)
  super(location: location)
  @variables = variables.dup.freeze
  @collection = collection
end

Instance Attribute Details

#collectionObject? (readonly)

Returns:

  • (Object, nil)


41
42
43
# File 'lib/ruby/rego/ast/query.rb', line 41

def collection
  @collection
end

#variablesArray<Variable> (readonly)

Returns:



38
39
40
# File 'lib/ruby/rego/ast/query.rb', line 38

def variables
  @variables
end