Class: Qrpm::Fragment::Expression
- Inherits:
-
FragmentContainer
- Object
- Fragment
- FragmentContainer
- Qrpm::Fragment::Expression
- Defined in:
- lib/qrpm/fragment.rb
Overview
A key or value as a list of Fragments
Instance Attribute Summary
Attributes inherited from Fragment
Instance Method Summary collapse
-
#initialize ⇒ Expression
constructor
A new instance of Expression.
- #interpolate ⇒ Object
Methods inherited from Fragment
#is_nil?, parse, #signature, #to_s, #variables
Constructor Details
#initialize ⇒ Expression
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
#interpolate ⇒ Object
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 |