Class: DailyTicketReport::Row

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ Row

Returns a new instance of Row.



38
39
40
41
42
43
44
45
# File 'app/models/daily_ticket_report.rb', line 38

def initialize(order)
  @id = order.id
  @ticket_details = order.ticket_details
  @total = DailyTicketReport.number_to_currency(order.tickets.sum(&:price).to_f/100)
  @person = order.person
  @person_id = order.person.id
  @special_instructions = order.special_instructions
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



37
38
39
# File 'app/models/daily_ticket_report.rb', line 37

def id
  @id
end

#personObject

Returns the value of attribute person.



37
38
39
# File 'app/models/daily_ticket_report.rb', line 37

def person
  @person
end

#person_idObject

Returns the value of attribute person_id.



37
38
39
# File 'app/models/daily_ticket_report.rb', line 37

def person_id
  @person_id
end

#special_instructionsObject

Returns the value of attribute special_instructions.



37
38
39
# File 'app/models/daily_ticket_report.rb', line 37

def special_instructions
  @special_instructions
end

#ticket_detailsObject

Returns the value of attribute ticket_details.



37
38
39
# File 'app/models/daily_ticket_report.rb', line 37

def ticket_details
  @ticket_details
end

#totalObject

Returns the value of attribute total.



37
38
39
# File 'app/models/daily_ticket_report.rb', line 37

def total
  @total
end

Instance Method Details

#to_aObject



47
48
49
# File 'app/models/daily_ticket_report.rb', line 47

def to_a
  [id, total, person, ticket_details, special_instructions]
end