Class: Nick

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/Common/Nick.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Instance Method Summary collapse

Instance Method Details

#get_nickObject



15
16
17
# File 'lib/Common/Nick.rb', line 15

def get_nick
	@nick
end

#ingroup?(group_name) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/Common/Nick.rb', line 26

def ingroup?(group_name)
	@mygroups=ManqodDB.instance.manqod_db.mygroups(@nick).clone if @mygroups.nil?
	@mygroups.has_value?(group_name)
end

#ingroup_id?(group_id) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
# File 'lib/Common/Nick.rb', line 30

def ingroup_id?(group_id)
	@mygroups=ManqodDB.instance.manqod_db.mygroups(@nick).clone if @mygroups.nil?
	@mygroups.has_key?(group_id.to_i)
end

#nick_idObject



19
20
21
22
23
24
# File 'lib/Common/Nick.rb', line 19

def nick_id
	if @nickid.nil?
		@nickid=ManqodDB.instance.manqod_db.admin.qrow("select id from users where nick='#{@nick}'")["id"]
	end
	@nickid
end

#set_nick(new_nick) ⇒ Object



11
12
13
# File 'lib/Common/Nick.rb', line 11

def set_nick(new_nick)
	@nick=new_nick
end