lib/aptible/auth/token.rb
def apply_oauth_response(oauth_token)
        # apply() + loaded is what HyperResource normally does after
        # deserializing a response back from the API. On top of that, we need
        # to set the Authorization header so that the token can be used to make
        # further API requests (e.g. accessing token#user or token#actor).
        adapter.apply(oauth_token.to_hash, self)
        self.loaded = true
        headers['Authorization'] = "Bearer #{bearer_token}"
        self
      end
# Unlike other resources, tokens aren't created in a REST fashion.
# Instead, they're created via OAuth grants. This means we need to
# override the way HyperResource / aptible-resource normally do things
# and plug in an OAuth library.
#
# To do so, we take control of the creation arguments and feed them into
# the OAuth2 library (in Token.create!), and then feed the response back
# to HyperResource (in Token#apply_oauth_response).
Unlike other resources, tokens aren't created in a REST fashion.
Instead, they're created via OAuth grants. This means we need to
override the way HyperResource / aptible-resource normally do things
and plug in an OAuth library.

To do so, we take control of the creation arguments and feed them into
the OAuth2 library (in Token.create!), and then feed the response back
to HyperResource (in Token#apply_oauth_response).
Unlike other resources tokens aren ' t created in a REST fashion . Instead they ' re created via OAuth grants . This means we need to override the way HyperResource / aptible - resource normally do things and plug in an OAuth library . To do so we take control of the creation arguments and feed them into the OAuth2 library ( in Token . create! ) and then feed the response back to HyperResource ( in Token#apply_oauth_response ) .
def apply_oauth_response(oauth_token)
        adapter.apply(oauth_token.to_hash, self)
        self.loaded = true
        headers['Authorization'] = "Bearer #{bearer_token}"
        self
      end
def apply_oauth_response ( oauth_token ) adapter . apply ( oauth_token . to_hash , self ) self . loaded = true headers [ 'Authorization' ] = "Bearer #{bearer_token}" self end
Unlike other resources, tokens aren't created in a REST fashion.
Unlike other resources tokens aren ' t created in a REST fashion .
# apply() + loaded is what HyperResource normally does after # deserializing a response back from the API. On top of that, we need # to set the Authorization header so that the token can be used to make # further API requests (e.g. accessing token#user or token#actor).
oauth_token