Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def display_price(grocery,batch)
- grocery_price = grocery.send(batch).price
- if grocery_price
- number_to_currency(grocery_price)
- else
- "NA"
- end
- end
- def loop(func,matrix)
- matrix.each { |matrix| display_price(@grocery,matrix) }
- end
- the "func argument" in the loop function is suppose to be
- display_price but how do i put it in if the "batch" is the thing that
- I want to be looped through?
Add Comment
Please, Sign In to add comment