Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. :my_symbol:
  2.  
  3. :symbol1
  4.  
  5. :symbol2
  6.  
  7. :another_symbol
  8.  
  9. def my_method
  10. if @data.has_key? my_symbol <- @data is how I check my yml file
  11. [:my_symbol].inject (0) do |symbol|
  12. if symbol.match /symbol1/
  13. count += 50
  14. elsif symbol.match /symbol2/
  15. count += 100
  16. end
  17. count
  18. end
  19. end
  20.  
  21. can't convert Symbol into Integer (TypeError)
  22. ./pages/mysymbol.rb:42:in `[]'
  23.  
  24. undefined method: match
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement