Sha256: 76fc8a7a8595aefbbe4997f998751319204ed5c36a4825faf8c0fe9109c569d8

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

require 'rack'

module RestCore::ClientOauth1
  include RestCore

  def authorize_url!
    set_token(Rack::Utils.parse_query(
      post(request_token_path, {}, {}, {:json_decode => false})))

    url(authorize_path, :oauth_token => oauth_token, :format => false)
  end

  def authorize! verifier
    set_token(Rack::Utils.parse_query(
      post(access_token_path, {}, {}, {:verifier => verifier,
                                       :json_decode => false})))
  end

  private
  def set_token query
    self.oauth_token        = query['oauth_token']
    self.oauth_token_secret = query['oauth_token_secret']
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rest-core-0.2.3 lib/rest-core/client_oauth1.rb
rest-core-0.2.2 lib/rest-core/client_oauth1.rb
rest-core-0.2.1 lib/rest-core/client_oauth1.rb
rest-core-0.2.0 lib/rest-core/client_oauth1.rb
rest-core-0.0.1 lib/rest-core/client_oauth1.rb