Class: Gem::ShoesFace::ProgressReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/shoes/setup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prog, status, size, initial_message, terminal_message = "complete") ⇒ ProgressReporter

Returns a new instance of ProgressReporter



291
292
293
294
295
296
297
# File 'lib/shoes/setup.rb', line 291

def initialize(prog, status, size, initial_message,
               terminal_message = "complete")
  @prog = prog
  (@status = status).replace initial_message
  @total = size
  @count = 0.0
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count



289
290
291
# File 'lib/shoes/setup.rb', line 289

def count
  @count
end

Instance Method Details

#doneObject



304
305
# File 'lib/shoes/setup.rb', line 304

def done
end

#updated(message) ⇒ Object



299
300
301
302
# File 'lib/shoes/setup.rb', line 299

def updated(message)
  @count += 1.0
  @prog.fraction = (@count / @total.to_f) * 0.5
end