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.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#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.
32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/door_list.rb', line 32 def initialize(ticket, buyer) sold_item = ticket.sold_item self.ticket = ticket self.buyer = buyer self.special_instructions = ticket.special_instructions self.notes = ticket.notes self.payment_method = sold_item.try(:order).try(:payment_method) self.order_id = sold_item.try(:order).try(:id) 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 |
#notes ⇒ Object
Returns the value of attribute notes.
20 21 22 |
# File 'app/models/door_list.rb', line 20 def notes @notes end |
#order_id ⇒ Object
Returns the value of attribute order_id.
20 21 22 |
# File 'app/models/door_list.rb', line 20 def order_id @order_id 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
43 44 45 |
# File 'app/models/door_list.rb', line 43 def <=>(obj) (self.ticket.buyer.last_name.try(:downcase) || "") <=> (obj.ticket.buyer.last_name.try(:downcase) || "") end |