Class: GirFFI::VariableNameGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi/variable_name_generator.rb

Overview

Generates a sequence of unique variable names used in generating function definitions.

Instance Method Summary collapse

Constructor Details

#initializeVariableNameGenerator

Returns a new instance of VariableNameGenerator.



7
8
9
# File 'lib/gir_ffi/variable_name_generator.rb', line 7

def initialize
  @varno = 0
end

Instance Method Details

#new_varObject



11
12
13
14
# File 'lib/gir_ffi/variable_name_generator.rb', line 11

def new_var
  @varno += 1
  "_v#{@varno}"
end