Class: TicketSummary
- Inherits:
-
Object
- Object
- TicketSummary
- Defined in:
- app/models/ticket_summary.rb
Defined Under Namespace
Classes: Row
Instance Attribute Summary collapse
-
#rows ⇒ Object
Returns the value of attribute rows.
Instance Method Summary collapse
- #<<(ticket) ⇒ Object
-
#initialize ⇒ TicketSummary
constructor
A new instance of TicketSummary.
- #row_for_this(show) ⇒ Object
Constructor Details
#initialize ⇒ TicketSummary
Returns a new instance of TicketSummary.
4 5 6 |
# File 'app/models/ticket_summary.rb', line 4 def initialize @rows = [] end |
Instance Attribute Details
#rows ⇒ Object
Returns the value of attribute rows.
2 3 4 |
# File 'app/models/ticket_summary.rb', line 2 def rows @rows end |
Instance Method Details
#<<(ticket) ⇒ Object
12 13 14 |
# File 'app/models/ticket_summary.rb', line 12 def <<(ticket) row_for_this(ticket.show) << ticket end |
#row_for_this(show) ⇒ Object
8 9 10 |
# File 'app/models/ticket_summary.rb', line 8 def row_for_this(show) @rows.find {|row| row.show == show} || (@rows << TicketSummary::Row.new).last end |