Class: Ruby::Rego::AST::Every

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

Overview

Represents an every expression.

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(value_var:, domain:, body:, key_var: nil, location: nil) ⇒ Every

Returns a new instance of Every.

Parameters:

  • value_var (Variable)
  • domain (Object)
  • body (Array<Object>)
  • key_var (Variable, nil) (defaults to: nil)
  • location (Location, nil) (defaults to: nil)


15
16
17
18
19
20
21
# File 'lib/ruby/rego/ast/every.rb', line 15

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

Instance Attribute Details

#bodyArray<Object> (readonly)

Returns:

  • (Array<Object>)


33
34
35
# File 'lib/ruby/rego/ast/every.rb', line 33

def body
  @body
end

#domainObject (readonly)

Returns:

  • (Object)


30
31
32
# File 'lib/ruby/rego/ast/every.rb', line 30

def domain
  @domain
end

#key_varVariable? (readonly)

Returns:



24
25
26
# File 'lib/ruby/rego/ast/every.rb', line 24

def key_var
  @key_var
end

#value_varVariable (readonly)

Returns:



27
28
29
# File 'lib/ruby/rego/ast/every.rb', line 27

def value_var
  @value_var
end