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

Version Path
artfully_ose-1.2.0.pre.9 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.8 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.7 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.6 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.5 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.4 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.3 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.2 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre.1 app/models/ticket_summary.rb
artfully_ose-1.2.0.pre app/models/ticket_summary.rb
artfully_ose-1.1.0 app/models/ticket_summary.rb
artfully_ose-1.1.0.rc2 app/models/ticket_summary.rb
artfully_ose-1.1.0.rc1 app/models/ticket_summary.rb
artfully_ose-1.0.0.rc4 app/models/ticket_summary.rb
artfully_ose-1.0.0.rc3 app/models/ticket_summary.rb