Class: Ruby2CExtension::Tools::UniqueNames

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby2cext/tools.rb

Instance Method Summary collapse

Constructor Details

#initializeUniqueNames

Returns a new instance of UniqueNames.



65
66
67
# File 'lib/ruby2cext/tools.rb', line 65

def initialize
	@prefix_cnt = Hash.new(0)
end

Instance Method Details

#get(prefix) ⇒ Object



68
69
70
# File 'lib/ruby2cext/tools.rb', line 68

def get(prefix)
	"#{prefix}_#{@prefix_cnt[prefix]+=1}"
end