Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Item
- attr_reader :order, :trophy
- def initialize(order, trophy)
- @order = order
- @trophy = trophy
- @shipping = order.shipping_person
- @address = Address.new(@shipping)
- end
- def program
- @trophy.program
- end
- def orderid
- @order.id
- end
- def email
- @order.email
- end
- def quantity
- @trophy.quantity
- end
- def year
- @trophy.year
- end
- def award
- if @trophy.award.end_with? ' of the Year' # this line seems to be the problem
- 'Grand w/ Wreath'
- else
- @trophy.award
- end
- end
- end
- # line if @trophy.award.end_with? ' of the Year' is giving:
- # item.rb:25:in `award': undefined method `end_with?' for nil:NilClass (NoMethodError)
Advertisement
Add Comment
Please, Sign In to add comment