Class: DoorList::Item

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ticket, buyer) ⇒ Item

Returns a new instance of Item.



31
32
33
34
35
36
# File 'app/models/door_list.rb', line 31

def initialize(ticket, buyer)
  self.ticket = ticket
  self.buyer = buyer
  self.special_instructions = ticket.special_instructions
  self.payment_method = ticket.sold_item.try(:order).try(:payment_method)
end

Instance Attribute Details

#buyerObject

Returns the value of attribute buyer.



20
21
22
# File 'app/models/door_list.rb', line 20

def buyer
  @buyer
end

#payment_methodObject

Returns the value of attribute payment_method.



20
21
22
# File 'app/models/door_list.rb', line 20

def payment_method
  @payment_method
end

#special_instructionsObject

Returns the value of attribute special_instructions.



20
21
22
# File 'app/models/door_list.rb', line 20

def special_instructions
  @special_instructions
end

#ticketObject

Returns the value of attribute ticket.



20
21
22
# File 'app/models/door_list.rb', line 20

def ticket
  @ticket
end

Instance Method Details

#<=>(obj) ⇒ Object



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

def <=>(obj)
  (self.ticket.buyer.last_name.try(:downcase) || "") <=> (obj.ticket.buyer.last_name.try(:downcase) || "")
end