Class: ProgressBar::Components::Rate

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-progressbar/components/rate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Rate

Returns a new instance of Rate.



10
11
12
13
14
15
16
# File 'lib/ruby-progressbar/components/rate.rb', line 10

def initialize(options = {})
  self.rate_scale = options[:rate_scale] || lambda { |x| x }
  self.started_at = nil
  self.stopped_at = nil
  self.timer      = options[:timer]
  self.progress   = options[:progress]
end

Instance Attribute Details

#progressObject

Returns the value of attribute progress.



4
5
6
# File 'lib/ruby-progressbar/components/rate.rb', line 4

def progress
  @progress
end

#rate_scaleObject

Returns the value of attribute rate_scale.



4
5
6
# File 'lib/ruby-progressbar/components/rate.rb', line 4

def rate_scale
  @rate_scale
end

#started_atObject

Returns the value of attribute started_at.



4
5
6
# File 'lib/ruby-progressbar/components/rate.rb', line 4

def started_at
  @started_at
end

#stopped_atObject

Returns the value of attribute stopped_at.



4
5
6
# File 'lib/ruby-progressbar/components/rate.rb', line 4

def stopped_at
  @stopped_at
end

#timerObject

Returns the value of attribute timer.



4
5
6
# File 'lib/ruby-progressbar/components/rate.rb', line 4

def timer
  @timer
end