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.
6 7 8 |
# File 'lib/gir_ffi/variable_name_generator.rb', line 6 def initialize @varno = 0 end |
Instance Method Details
#new_var ⇒ Object
10 11 12 13 |
# File 'lib/gir_ffi/variable_name_generator.rb', line 10 def new_var @varno += 1 "_v#{@varno}" end |