Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/acts_as_qa/array.rb
Instance Method Summary collapse
Instance Method Details
#aaq_avg ⇒ Object
12 13 14 |
# File 'lib/acts_as_qa/array.rb', line 12 def aaq_avg self.aaq_sum/self.length end |
#aaq_percentage ⇒ Object
7 8 9 10 |
# File 'lib/acts_as_qa/array.rb', line 7 def aaq_percentage return 100 if self.aaq_sum.nil? self.aaq_sum*100/self.length end |
#aaq_sum ⇒ Object
3 4 5 |
# File 'lib/acts_as_qa/array.rb', line 3 def aaq_sum inject( nil ) { |sum,x| sum ? sum+x : x } end |