Class: TicketSummary::Row
- Inherits:
-
Object
- Object
- TicketSummary::Row
- Defined in:
- app/models/ticket_summary.rb
Instance Attribute Summary collapse
-
#show ⇒ Object
Returns the value of attribute show.
-
#ticket_type_hash ⇒ Object
Returns the value of attribute ticket_type_hash.
-
#tickets ⇒ Object
Returns the value of attribute tickets.
Instance Method Summary collapse
- #<<(ticket) ⇒ Object
-
#initialize ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize ⇒ Row
Returns a new instance of Row.
19 20 21 22 |
# File 'app/models/ticket_summary.rb', line 19 def initialize @tickets = [] @ticket_type_hash = {} end |
Instance Attribute Details
#show ⇒ Object
Returns the value of attribute show.
17 18 19 |
# File 'app/models/ticket_summary.rb', line 17 def show @show end |
#ticket_type_hash ⇒ Object
Returns the value of attribute ticket_type_hash.
17 18 19 |
# File 'app/models/ticket_summary.rb', line 17 def ticket_type_hash @ticket_type_hash end |
#tickets ⇒ Object
Returns the value of attribute tickets.
17 18 19 |
# File 'app/models/ticket_summary.rb', line 17 def tickets @tickets end |
Instance Method Details
#<<(ticket) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/ticket_summary.rb', line 24 def <<(ticket) @tickets << ticket if @ticket_type_hash[ticket.ticket_type].nil? @ticket_type_hash[ticket.ticket_type] = [] end @ticket_type_hash[ticket.ticket_type] << ticket @show = ticket.show self end |