Class: Ruby::Rego::AST::Reference
- Defined in:
- lib/ruby/rego/ast/reference.rb
Overview
Represents a reference to nested data (e.g. input.user.roles[0]).
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
-
#path ⇒ Array<RefArg>
readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(base:, path:, location: nil) ⇒ Reference
constructor
A new instance of Reference.
Methods inherited from Base
#==, #accept, #deconstruct_keys, #eql?, format_value, #hash, #to_s
Constructor Details
#initialize(base:, path:, location: nil) ⇒ Reference
Returns a new instance of Reference.
13 14 15 16 17 |
# File 'lib/ruby/rego/ast/reference.rb', line 13 def initialize(base:, path:, location: nil) super(location: location) @base = base @path = path.dup.freeze end |
Instance Attribute Details
#base ⇒ Object (readonly)
20 21 22 |
# File 'lib/ruby/rego/ast/reference.rb', line 20 def base @base end |
#path ⇒ Array<RefArg> (readonly)
23 24 25 |
# File 'lib/ruby/rego/ast/reference.rb', line 23 def path @path end |