Sha256: 6bc60282c03dcb529a6bbdb333d0a75a0d0537302b4e395f375c7c3757c0daa6
Contents?: true
Size: 429 Bytes
Versions: 37
Compression:
Stored size: 429 Bytes
Contents
class SectionSummary attr_accessor :total, :sold, :comped, :available def self.for_tickets(tickets = []) summary = SectionSummary.new summary.total = tickets.size summary.sold = tickets.select{|t| t.sold?}.size summary.comped = tickets.select{|t| t.comped?}.size summary.available = tickets.select{|t| t.on_sale?}.size summary end def off_sale total - available - sold - comped end end
Version data entries
37 entries across 37 versions & 1 rubygems