Class: TinyIRC::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/tinyirc/perms.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Group

Returns a new instance of Group.



34
35
36
37
38
# File 'lib/tinyirc/perms.rb', line 34

def initialize(name)
  @name  = name
  @perms = Set.new
  TinyIRC::Group::log.write "groups += #{name}"
end

Class Attribute Details

.logObject (readonly)

Returns the value of attribute log.



27
28
29
# File 'lib/tinyirc/perms.rb', line 27

def log
  @log
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



32
33
34
# File 'lib/tinyirc/perms.rb', line 32

def name
  @name
end

#permsObject (readonly)

Returns the value of attribute perms.



32
33
34
# File 'lib/tinyirc/perms.rb', line 32

def perms
  @perms
end

Instance Method Details

#perm(plugin, command, branch) ⇒ Object



40
41
42
43
44
# File 'lib/tinyirc/perms.rb', line 40

def perm(plugin, command, branch)
  if @perms.add?(TinyIRC::Permission.new(plugin, command, branch))
    TinyIRC::Group::log.write "#{@name} += #{plugin}/#{command}/#{branch}"
  end
end