Class: Ruby::Rego::AST::SetLiteral

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

Overview

Represents a set literal.

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(elements:, location: nil) ⇒ SetLiteral

Returns a new instance of SetLiteral.

Parameters:

  • elements (Array<Object>)
  • location (Location, nil) (defaults to: nil)


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

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

Instance Attribute Details

#elementsArray<Object> (readonly)

Returns:

  • (Array<Object>)


44
45
46
# File 'lib/ruby/rego/ast/composite.rb', line 44

def elements
  @elements
end