Class: Ruby::Rego::AST::SetComprehension

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

Overview

Represents a set comprehension.

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(term:, body:, location: nil) ⇒ SetComprehension

Returns a new instance of SetComprehension.

Parameters:

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


49
50
51
52
53
# File 'lib/ruby/rego/ast/comprehension.rb', line 49

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

Instance Attribute Details

#bodyObject (readonly)

Returns:

  • (Object)


59
60
61
# File 'lib/ruby/rego/ast/comprehension.rb', line 59

def body
  @body
end

#termObject (readonly)

Returns:

  • (Object)


56
57
58
# File 'lib/ruby/rego/ast/comprehension.rb', line 56

def term
  @term
end