Class: GirFFI::VariableNameGenerator
- Inherits:
-
Object
- Object
- GirFFI::VariableNameGenerator
- 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
-
#initialize ⇒ VariableNameGenerator
constructor
A new instance of VariableNameGenerator.
- #new_var ⇒ Object
Constructor Details
#initialize ⇒ VariableNameGenerator
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_var ⇒ Object
11 12 13 14 |
# File 'lib/gir_ffi/variable_name_generator.rb', line 11 def new_var @varno += 1 "_v#{@varno}" end |