Class: Ruby::Rego::AST::ObjectLiteral
- Defined in:
- lib/ruby/rego/ast/composite.rb
Overview
Represents an object literal.
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(pairs:, location: nil) ⇒ ObjectLiteral
constructor
A new instance of ObjectLiteral.
Methods inherited from Base
#==, #accept, #deconstruct_keys, #eql?, format_value, #hash, #to_s
Constructor Details
#initialize(pairs:, location: nil) ⇒ ObjectLiteral
Returns a new instance of ObjectLiteral.
25 26 27 28 |
# File 'lib/ruby/rego/ast/composite.rb', line 25 def initialize(pairs:, location: nil) super(location: location) @pairs = pairs.map { |pair| pair.dup.freeze }.freeze end |
Instance Attribute Details
#pairs ⇒ Array<Array(Object, Object)> (readonly)
31 32 33 |
# File 'lib/ruby/rego/ast/composite.rb', line 31 def pairs @pairs end |