Class: Terrafying::IndexRef

Inherits:
Ref
  • Object
show all
Defined in:
lib/terrafying/generator.rb

Instance Method Summary collapse

Methods inherited from Ref

#<=>, #==, #[], #[]=, #downcase, #fn_call, #slice, #split, #strip, #to_s, #to_str

Constructor Details

#initialize(ref:, idx:) ⇒ IndexRef

Returns a new instance of IndexRef.



127
128
129
130
131
132
133
# File 'lib/terrafying/generator.rb', line 127

def initialize(
      ref:,
      idx:
    )
  @ref = ref
  @idx = idx
end

Instance Method Details

#realiseObject



135
136
137
# File 'lib/terrafying/generator.rb', line 135

def realise
  "#{@ref.realise}[#{@idx}]"
end