Class: Ruby::Rego::AST::Variable

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

Overview

Represents a variable identifier.

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(name:, location: nil) ⇒ Variable

Returns a new instance of Variable.

Parameters:

  • name (String)
  • location (Location, nil) (defaults to: nil)


12
13
14
15
# File 'lib/ruby/rego/ast/variable.rb', line 12

def initialize(name:, location: nil)
  super(location: location)
  @name = name
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/ruby/rego/ast/variable.rb', line 18

def name
  @name
end