Module: Fullscriptapi
- Extended by:
- AuthenticationEndpoints, Servers
- Defined in:
- lib/fullscriptapi.rb,
lib/fullscriptapi/servers.rb,
lib/fullscriptapi/version.rb,
lib/fullscriptapi/access_token.rb,
lib/fullscriptapi/authentication_endpoints.rb,
lib/fullscriptapi/authentication_endpoints/refresh_token.rb,
lib/fullscriptapi/authentication_endpoints/create_an_oauth_token.rb
Defined Under Namespace
Modules: AuthenticationEndpoints, Servers Classes: AccessToken
Constant Summary collapse
- VERSION =
"0.3.5"
Constants included from Servers
Class Attribute Summary collapse
-
.client_id ⇒ Object
Returns the value of attribute client_id.
-
.redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
.secret ⇒ Object
Returns the value of attribute secret.
-
.server ⇒ Object
Returns the value of attribute server.
-
.token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
- .config {|_self| ... } ⇒ Object (also: new)
- .method_missing(name, *args, &block) ⇒ Object
- .use_token(opts = {}) ⇒ Object
Methods included from Servers
Methods included from AuthenticationEndpoints::RefreshToken
Methods included from AuthenticationEndpoints::CreateAnOauthToken
Class Attribute Details
.client_id ⇒ Object
Returns the value of attribute client_id.
13 14 15 |
# File 'lib/fullscriptapi.rb', line 13 def client_id @client_id end |
.redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
13 14 15 |
# File 'lib/fullscriptapi.rb', line 13 def redirect_uri @redirect_uri end |
.secret ⇒ Object
Returns the value of attribute secret.
13 14 15 |
# File 'lib/fullscriptapi.rb', line 13 def secret @secret end |
.server ⇒ Object
Returns the value of attribute server.
13 14 15 |
# File 'lib/fullscriptapi.rb', line 13 def server @server end |
.token ⇒ Object
Returns the value of attribute token.
13 14 15 |
# File 'lib/fullscriptapi.rb', line 13 def token @token end |
Class Method Details
.config {|_self| ... } ⇒ Object Also known as: new
15 16 17 18 19 |
# File 'lib/fullscriptapi.rb', line 15 def config yield self if block_given? self end |
.method_missing(name, *args, &block) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fullscriptapi.rb', line 27 def method_missing(name, *args, &block) @requested_method_hash = .detect { |v| v[:api_method] == name.to_s } super unless requested_method_hash refresh_token if stale_token? # TO-DO: write logic to improve token refresh params = excon_params(*args) Excon.send(*params) end |
.use_token(opts = {}) ⇒ Object
22 23 24 25 |
# File 'lib/fullscriptapi.rb', line 22 def use_token(opts = {}) # pass in a hash containing token attributes e.g. access_token, refresh_token, expires_* @token = Fullscriptapi::AccessToken.new(opts) end |