Sha256: 4f64e93d77775b2ff872b03fa39f7f7c6337de5a97b976a675f7308ada1b0f36
Contents?: true
Size: 482 Bytes
Versions: 15
Compression:
Stored size: 482 Bytes
Contents
class TicketSummary attr_accessor :rows def initialize @rows = [] end def row_for_this(show) @rows.find {|row| row.show == show} || (@rows << TicketSummary::Row.new).last end def <<(ticket) row_for_this(ticket.show) << ticket end class TicketSummary::Row attr_accessor :show, :tickets def initialize @tickets = [] end def <<(ticket) @tickets << ticket @show = ticket.show self end end end
Version data entries
15 entries across 15 versions & 1 rubygems