Class: TicketSummary::Row

Inherits:
Object
  • Object
show all
Defined in:
app/models/ticket_summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRow

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

#showObject

Returns the value of attribute show.



17
18
19
# File 'app/models/ticket_summary.rb', line 17

def show
  @show
end

#ticket_type_hashObject

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

#ticketsObject

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