Class: Ruby::Rego::AST::TemplateString

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

Overview

Represents a template string with interpolations.

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(parts:, location: nil) ⇒ TemplateString

Returns a new instance of TemplateString.

Parameters:

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


34
35
36
37
# File 'lib/ruby/rego/ast/literal.rb', line 34

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

Instance Attribute Details

#partsArray<Object> (readonly)

Returns:

  • (Array<Object>)


40
41
42
# File 'lib/ruby/rego/ast/literal.rb', line 40

def parts
  @parts
end