Sha256: 378ad2e74e5e60d5b12dd2d9469f9e5a0eaf075210c29636567b2084349b75d2

Contents?: true

Size: 617 Bytes

Versions: 9

Compression:

Stored size: 617 Bytes

Contents

require 'rest-core'

module RestCore::ClientOauth1
  include RestCore

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

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

  def authorize! verifier
    set_token(Vendor.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

9 entries across 9 versions & 1 rubygems

Version Path
rest-core-0.7.0 lib/rest-core/client_oauth1.rb
rest-core-0.4.0 lib/rest-core/client_oauth1.rb
rest-core-0.4.0.pre.2 lib/rest-core/client_oauth1.rb
rest-core-0.4.0.pre.1 lib/rest-core/client_oauth1.rb
rest-core-0.4.0.pre.0 lib/rest-core/client_oauth1.rb
rest-core-0.3.0 lib/rest-core/client_oauth1.rb
rest-core-0.3.0.pre.2 lib/rest-core/client_oauth1.rb
rest-core-0.3.0.pre.1 lib/rest-core/client_oauth1.rb
rest-core-0.3.0.pre.0 lib/rest-core/client_oauth1.rb