Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Player < GatherPlugin
- attr_accessor :level, :nick, :hostmask, :username, :password, :email, :points, :mode
- def self.find(source)
- p = YAML::load_file(PLAYERLIST)
- p.each do |k, v|
- if v['hostmask'] == source.hostmask
- @level = v['level'] || 1
- @nick = v['nick']
- @hostmask = v['hostmask']
- @username = v['username']
- @password = v['password'].to_s
- @email = v['email']
- @points = v['points'] || 1000
- @mode = v['mode'] || ""
- break
- end
- end
- return
- end
- end
- Player.find('Innu').email
- #<NoMethodError: undefined method `email' for nil:NilClass>
Add Comment
Please, Sign In to add comment