Module: Create::AutoIds
Instance Method Summary collapse
-
#next(klass) ⇒ Object
Get the next auto-incrementing id for the given klass.
Instance Method Details
#next(klass) ⇒ Object
Get the next auto-incrementing id for the given klass
24 25 26 27 28 |
# File 'lib/fabrial/create.rb', line 24 def next(klass) id = @ids[klass] || 1 @ids[klass] += 1 id end |