class Mumukit::Auth::Grant

Public Class Methods

parse(pattern) click to toggle source
# File lib/mumukit/auth/grant.rb, line 34
def self.parse(pattern)
  case pattern
    when '*' then
      AllGrant.new
    when '*/*' then
      AllGrant.new
    when /(.*)\/\*/
      FirstPartGrant.new($1)
    else
      SingleGrant.new(Slug.parse pattern)
  end
end

Public Instance Methods

==(other) click to toggle source
# File lib/mumukit/auth/grant.rb, line 20
def ==(other)
  other.class == self.class && to_s == other.to_s
end
Also aliased as: eql?
as_json(options={}) click to toggle source
# File lib/mumukit/auth/grant.rb, line 12
def as_json(options={})
  to_s
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/mumukit/auth/grant.rb, line 26
def hash
  to_s.hash
end
inspect() click to toggle source
# File lib/mumukit/auth/grant.rb, line 30
def inspect
  "<Mumukit::Auth::Grant #{to_s}>"
end
to_mumukit_grant() click to toggle source
# File lib/mumukit/auth/grant.rb, line 16
def to_mumukit_grant
  self
end