Class: Devise::Oauth2::AccessToken
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Devise::Oauth2::AccessToken
- Defined in:
- app/models/devise/oauth2/access_token.rb
Instance Method Summary collapse
Instance Method Details
#can?(do_permission) ⇒ Boolean
26 27 28 |
# File 'app/models/devise/oauth2/access_token.rb', line 26 def can?() .to_s.in? Array(self.) end |
#permissions=(permissions) ⇒ Object
10 11 12 13 14 |
# File 'app/models/devise/oauth2/access_token.rb', line 10 def () super() if .is_a? Array = .split(/[,\s\n\b\t]/).keep_if { |x| !x.empty? } if .is_a? String super() end |
#token_response ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/models/devise/oauth2/access_token.rb', line 16 def token_response response = { :access_token => token, :token_type => 'bearer', :expires_in => expires_in } response[:refresh_token] = refresh_token.token if refresh_token response end |