Module: Neo4j::Spatial::Listener

Included in:
OSMImporter, SHPImporter
Defined in:
lib/neo4j/spatial/listener.rb

Instance Method Summary collapse

Instance Method Details

#begin(units_of_work) ⇒ Object



11
12
13
14
15
# File 'lib/neo4j/spatial/listener.rb', line 11

def begin(units_of_work)
  @work = units_of_work
  @work = 100 if(@work<1)
  @worked = 0
end

#doneObject



20
21
22
23
# File 'lib/neo4j/spatial/listener.rb', line 20

def done
  @worked = @work
  progress
end

#initialize(dbpath = nil) ⇒ Object



7
8
9
10
# File 'lib/neo4j/spatial/listener.rb', line 7

def initialize(dbpath=nil)
  @work = 100
  @worked = 0
end

#progressObject



24
25
26
# File 'lib/neo4j/spatial/listener.rb', line 24

def progress
  puts "#{100*@worked/@work}% #{self}"
end

#worked(worked_since_last_notification) ⇒ Object



16
17
18
19
# File 'lib/neo4j/spatial/listener.rb', line 16

def worked(worked_since_last_notification)
  @worked += worked_since_last_notification
  progress
end