Guest User

Untitled

a guest
Apr 11th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class Player < GatherPlugin
  2.  
  3. attr_accessor :level, :nick, :hostmask, :username, :password, :email, :points, :mode
  4.  
  5. def self.find(source)
  6. p = YAML::load_file(PLAYERLIST)
  7. p.each do |k, v|
  8. if v['hostmask'] == source.hostmask
  9. @level = v['level'] || 1
  10. @nick = v['nick']
  11. @hostmask = v['hostmask']
  12. @username = v['username']
  13. @password = v['password'].to_s
  14. @email = v['email']
  15. @points = v['points'] || 1000
  16. @mode = v['mode'] || ""
  17. break
  18. end
  19. end
  20. return
  21. end
  22.  
  23. end
  24.  
  25. Player.find('Innu').email
  26. #<NoMethodError: undefined method `email' for nil:NilClass>
Add Comment
Please, Sign In to add comment