Class: LittleWrapper
- Inherits:
-
Object
- Object
- LittleWrapper
- Defined in:
- lib/pqa.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#q ⇒ Object
Returns the value of attribute q.
-
#total_duration ⇒ Object
Returns the value of attribute total_duration.
Instance Method Summary collapse
- #add(q) ⇒ Object
-
#initialize(q) ⇒ LittleWrapper
constructor
A new instance of LittleWrapper.
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
#count ⇒ Object
Returns the value of attribute count.
986 987 988 |
# File 'lib/pqa.rb', line 986 def count @count end |
#q ⇒ Object
Returns the value of attribute q.
986 987 988 |
# File 'lib/pqa.rb', line 986 def q @q end |
#total_duration ⇒ Object
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 |