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



273
274
275
276
277
278
279
# File 'lib/shoes/setup.rb', line 273

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



271
272
273
# File 'lib/shoes/setup.rb', line 271

def count
  @count
end

Instance Method Details

#doneObject



286
287
# File 'lib/shoes/setup.rb', line 286

def done
end

#updated(message) ⇒ Object



281
282
283
284
# File 'lib/shoes/setup.rb', line 281

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