Sha256: 7f0d1df01bd1d28ed065ed86f6a972bcee271cf9480df8c2558b35f8bcba2dd6

Contents?: true

Size: 286 Bytes

Versions: 9

Compression:

Stored size: 286 Bytes

Contents

# frozen_string_literal: true
module GirFFI
  # Generates a sequence of unique variable names used in generating
  # function definitions.
  class VariableNameGenerator
    def initialize
      @varno = 0
    end

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.11.0 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.10.2 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.10.1 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.10.0 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.10.0.pre1 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.9.5 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.9.4 lib/gir_ffi/variable_name_generator.rb
gir_ffi-0.9.3 lib/gir_ffi/variable_name_generator.rb