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.



122
123
124
125
126
127
128
# File 'lib/terrafying/generator.rb', line 122

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

Instance Method Details

#realiseObject



130
131
132
# File 'lib/terrafying/generator.rb', line 130

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