Class: Ruby2CExtension::Tools::UniqueNames
- Inherits:
-
Object
- Object
- Ruby2CExtension::Tools::UniqueNames
- Defined in:
- lib/ruby2cext/tools.rb
Instance Method Summary collapse
- #get(prefix) ⇒ Object
-
#initialize ⇒ UniqueNames
constructor
A new instance of UniqueNames.
Constructor Details
#initialize ⇒ UniqueNames
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 |