Class: DoorList::Item
- Inherits:
-
Object
- Object
- DoorList::Item
- Defined in:
- app/models/door_list.rb
Instance Attribute Summary collapse
-
#buyer ⇒ Object
Returns the value of attribute buyer.
-
#payment_method ⇒ Object
Returns the value of attribute payment_method.
-
#special_instructions ⇒ Object
Returns the value of attribute special_instructions.
-
#ticket ⇒ Object
Returns the value of attribute ticket.
Instance Method Summary collapse
- #<=>(obj) ⇒ Object
-
#initialize(ticket, buyer) ⇒ Item
constructor
A new instance of Item.
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
#buyer ⇒ Object
Returns the value of attribute buyer.
20 21 22 |
# File 'app/models/door_list.rb', line 20 def buyer @buyer end |
#payment_method ⇒ Object
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_instructions ⇒ Object
Returns the value of attribute special_instructions.
20 21 22 |
# File 'app/models/door_list.rb', line 20 def special_instructions @special_instructions end |
#ticket ⇒ Object
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 |