Class: Ticket::Reports::Available

Inherits:
Base
  • Object
show all
Defined in:
app/models/ticket/reports.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, reporting_methods

Constructor Details

This class inherits a constructor from Ticket::Reports::Base

Instance Method Details

#capacityObject



42
43
44
# File 'app/models/ticket/reports.rb', line 42

def capacity
  tickets.length
end

#off_saleObject



34
35
36
# File 'app/models/ticket/reports.rb', line 34

def off_sale
  tickets.select(&:off_sale?).length
end

#on_saleObject



30
31
32
# File 'app/models/ticket/reports.rb', line 30

def on_sale
  total
end

#openObject



38
39
40
# File 'app/models/ticket/reports.rb', line 38

def open
  on_sale + off_sale
end

#totalObject



26
27
28
# File 'app/models/ticket/reports.rb', line 26

def total
  tickets.select(&:on_sale?).length
end