Class: Rubernate::DBI::PKChunk

Inherits:
Object
  • Object
show all
Defined in:
lib/rubernate/impl/dbi_genpk.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/rubernate/impl/dbi_genpk.rb', line 9

def empty?
  @next >= @limit
end

#get_pkObject



12
13
14
15
# File 'lib/rubernate/impl/dbi_genpk.rb', line 12

def get_pk
  @next+= 1
  @next - 1
end