Class: Authentication::OAuth2
- Inherits:
-
Base
- Object
- Base
- Authentication::OAuth2
- Defined in:
- lib/haveapi/go_client/authentication/oauth2.rb
Instance Attribute Summary collapse
-
#http_header ⇒ String
readonly
HTTP header the token is sent in.
-
#revoke_url ⇒ String
readonly
Token revocation URL.
Instance Method Summary collapse
- #generate(gen) ⇒ Object
-
#initialize(api_version, name, desc) ⇒ OAuth2
constructor
A new instance of OAuth2.
Constructor Details
#initialize(api_version, name, desc) ⇒ OAuth2
Returns a new instance of OAuth2.
15 16 17 18 19 |
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 15 def initialize(api_version, name, desc) super @http_header = desc[:http_header] @revoke_url = desc[:revoke_url] end |
Instance Attribute Details
#http_header ⇒ String (readonly)
HTTP header the token is sent in
9 10 11 |
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 9 def http_header @http_header end |
#revoke_url ⇒ String (readonly)
Token revocation URL
13 14 15 |
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 13 def revoke_url @revoke_url end |
Instance Method Details
#generate(gen) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/haveapi/go_client/authentication/oauth2.rb', line 21 def generate(gen) ErbTemplate.render_to_if_changed( 'authentication/oauth2.go', { package: gen.package, auth: self }, File.join(gen.dst, 'auth_oauth2.go') ) end |