Module: PivotTable::CellCollection
Constant Summary collapse
- ACCESSORS =
[:header, :data, :value_name, :orthogonal_headers]
Instance Method Summary collapse
Instance Method Details
#initialize(options = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/pivot_table/cell_collection.rb', line 10 def initialize( = {}) ACCESSORS.each do |a| self.send("#{a}=", [a]) if .has_key?(a) end end |
#total ⇒ Object
16 17 18 |
# File 'lib/pivot_table/cell_collection.rb', line 16 def total data.inject(0) { |t, x| t + (x ? x.send(value_name) : 0) } end |