Class: Mumukit::Auth::FirstPartGrant
- Inherits:
-
Grant
- Object
- Grant
- Mumukit::Auth::FirstPartGrant
show all
- Defined in:
- lib/mumukit/auth/grant.rb
Instance Method Summary
collapse
Methods inherited from Grant
#==, #as_json, #hash, #inspect, parse, #to_mumukit_grant
Constructor Details
Returns a new instance of FirstPartGrant.
61
62
63
|
# File 'lib/mumukit/auth/grant.rb', line 61
def initialize(first)
@first = first
end
|
Instance Method Details
#allows?(resource_slug) ⇒ Boolean
65
66
67
|
# File 'lib/mumukit/auth/grant.rb', line 65
def allows?(resource_slug)
resource_slug.to_mumukit_slug.match_first @first
end
|
#to_mumukit_slug ⇒ Object
73
74
75
|
# File 'lib/mumukit/auth/grant.rb', line 73
def to_mumukit_slug
Mumukit::Auth::Slug.new @first, '*'
end
|
#to_s ⇒ Object
69
70
71
|
# File 'lib/mumukit/auth/grant.rb', line 69
def to_s
"#{@first}/*"
end
|