Module: Devise::Oauth::Scopable
- Extended by:
- ActiveSupport::Concern
- Included in:
- AccessToken, Authorization, Client
- Defined in:
- lib/devise/oauth/scopable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#has_scope?(scope) ⇒ Boolean
12 13 14 |
# File 'lib/devise/oauth/scopable.rb', line 12 def has_scope?(scope) self.scope_mask & self.class.scope_to_mask(scope) > 0 end |
#scope ⇒ Object
8 9 10 |
# File 'lib/devise/oauth/scopable.rb', line 8 def scope self.class.mask_to_scope(scope_mask) end |
#scope=(scope) ⇒ Object
4 5 6 |
# File 'lib/devise/oauth/scopable.rb', line 4 def scope=(scope) self.scope_mask = self.class.scope_to_mask(scope) end |
#scope_to_response ⇒ Object
16 17 18 |
# File 'lib/devise/oauth/scopable.rb', line 16 def scope_to_response scope.join(" ") end |