Class: Rubernate::DBI::PKChunk
- Inherits:
-
Object
- Object
- Rubernate::DBI::PKChunk
- Defined in:
- lib/rubernate/impl/dbi_genpk.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #get_pk ⇒ Object
-
#initialize(first, size) ⇒ PKChunk
constructor
A new instance of PKChunk.
Constructor Details
#initialize(first, size) ⇒ PKChunk
Returns a new instance of PKChunk.
6 7 8 |
# File 'lib/rubernate/impl/dbi_genpk.rb', line 6 def initialize first, size @next, @limit = first, first + size end |
Instance Method Details
#empty? ⇒ Boolean
9 10 11 |
# File 'lib/rubernate/impl/dbi_genpk.rb', line 9 def empty? @next >= @limit end |
#get_pk ⇒ Object
12 13 14 15 |
# File 'lib/rubernate/impl/dbi_genpk.rb', line 12 def get_pk @next+= 1 @next - 1 end |