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.



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

def initialize
  @varno = 0
end

Instance Method Details

#new_varObject



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

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