class TinyIRC::Permission

Attributes

branch[R]
command[R]
plugin[R]

Public Class Methods

new(plugin, command, branch) click to toggle source
# File lib/tinyirc/perms.rb, line 10
def initialize(plugin, command, branch)
  @plugin  = plugin
  @command = command
  @branch  = branch
end
parse(pstr) click to toggle source
# File lib/tinyirc/perms.rb, line 4
def self.parse(pstr)
  a = pstr.split('/', 3)
  raise RuntimeError, "Invalid permission: #{pstr}" unless a[0] || !a[1] && a[2]
  [a[0], a[1] || :all, a[2] || :all]
end

Public Instance Methods

==(other) click to toggle source
# File lib/tinyirc/perms.rb, line 16
def ==(other)
  @plugin == other.plugin && @command == other.command && @branch == other.branch
end
to_s() click to toggle source
# File lib/tinyirc/perms.rb, line 20
def to_s
  "#{@plugin}/#{@command}/#{@branch}"
end