Class: InCSV::Progress

Inherits:
Object
  • Object
show all
Defined in:
lib/incsv/console/progress.rb

Instance Method Summary collapse

Constructor Details

#initialize(output: $stdout, message: "Working...") ⇒ Progress

Returns a new instance of Progress.



5
6
7
8
# File 'lib/incsv/console/progress.rb', line 5

def initialize(output: $stdout, message: "Working...")
  @output = output
  @message = message
end

Instance Method Details

#clearObject



17
18
19
20
# File 'lib/incsv/console/progress.rb', line 17

def clear
  output.print "\r"
  output.print " " * width
end

#indeterminateObject



10
11
12
13
14
15
# File 'lib/incsv/console/progress.rb', line 10

def indeterminate
  loop do
    line
    sleep 1
  end
end