Guest User

Untitled

a guest
May 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def display_price(grocery,batch)
  2. grocery_price = grocery.send(batch).price
  3. if grocery_price
  4. number_to_currency(grocery_price)
  5. else
  6. "NA"
  7. end
  8. end
  9.  
  10. def loop(func,matrix)
  11.  
  12. matrix.each { |matrix| display_price(@grocery,matrix) }
  13.  
  14. end
  15.  
  16.  
  17. the "func argument" in the loop function is suppose to be
  18. display_price but how do i put it in if the "batch" is the thing that
  19. I want to be looped through?
Add Comment
Please, Sign In to add comment