Class: Qrpm::Fragment::Expression

Inherits:
FragmentContainer show all
Defined in:
lib/qrpm/fragment.rb

Overview

A key or value as a list of Fragments

Instance Attribute Summary

Attributes inherited from Fragment

#fragments, #source

Instance Method Summary collapse

Methods inherited from Fragment

#is_nil?, parse, #signature, #to_s, #variables

Constructor Details

#initializeExpression

Returns a new instance of Expression.



163
164
165
166
# File 'lib/qrpm/fragment.rb', line 163

def initialize(...)
  super
  @seen = {}
end

Instance Method Details

#interpolateObject



168
169
170
171
172
173
# File 'lib/qrpm/fragment.rb', line 168

def interpolate(...)
  r = super
  !@seen.key?(r.inspect) or raise CompileError.new "Duplicate interpolation: #{r.inspect}"
  @seen[r.inspect] = true
  r
end