Class: LittleWrapper

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(q) ⇒ LittleWrapper

Returns a new instance of LittleWrapper.



988
989
990
991
992
# File 'lib/pqa.rb', line 988

def initialize(q)
  @q = q
  @total_duration = 0.0
  @count = 0
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



986
987
988
# File 'lib/pqa.rb', line 986

def count
  @count
end

#qObject

Returns the value of attribute q.



986
987
988
# File 'lib/pqa.rb', line 986

def q
  @q
end

#total_durationObject

Returns the value of attribute total_duration.



986
987
988
# File 'lib/pqa.rb', line 986

def total_duration
  @total_duration
end

Instance Method Details

#add(q) ⇒ Object



994
995
996
997
998
# File 'lib/pqa.rb', line 994

def add(q)
  return if q.duration.nil?
  @total_duration += q.duration
  @count += 1
end