class Array
Public Instance Methods
snapshots()
click to toggle source
# File lib/invoice/array.rb, line 2 def snapshots self.find_all{ |row| (row['UsageType'].scan /:(.+)$/).flatten.first == 'SnapshotUsage' } end
total_price()
click to toggle source
# File lib/invoice/array.rb, line 6 def total_price total = 0 self.each{ |row| total += row['TotalCost'] } total.round(2) end