Sha256: 7f4ebac285085b814e624f5610690bdae2351cbc55c6a34452e1cb9255863b66

Contents?: true

Size: 635 Bytes

Versions: 11

Compression:

Stored size: 635 Bytes

Contents

module Twitter
  class HTTPAuth
    include HTTParty
    base_uri 'http://twitter.com'
    format :plain
    
    attr_reader :username, :password
    
    def initialize(username, password)
      @username, @password = username, password
    end
    
    def get(uri, headers={})
      self.class.get(uri, :headers => headers, :basic_auth => basic_auth)
    end
    
    def post(uri, body={}, headers={})
      self.class.post(uri, :body => body, :headers => headers, :basic_auth => basic_auth)
    end
    
    private
      def basic_auth
        @basic_auth ||= {:username => @username, :password => @password}
      end
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
cicloid-twitter-0.6.1 lib/twitter/httpauth.rb
cicloid-twitter-0.6.2 lib/twitter/httpauth.rb
dacort-twitter-0.6.5 lib/twitter/httpauth.rb
jnunemaker-twitter-0.6.0 lib/twitter/httpauth.rb
jnunemaker-twitter-0.6.1 lib/twitter/httpauth.rb
jnunemaker-twitter-0.6.2 lib/twitter/httpauth.rb
jnunemaker-twitter-0.6.3 lib/twitter/httpauth.rb
jnunemaker-twitter-0.6.4 lib/twitter/httpauth.rb
jnunemaker-twitter-0.6.5 lib/twitter/httpauth.rb
szimek-twitter-0.6.4 lib/twitter/httpauth.rb
szimek-twitter-0.6.5 lib/twitter/httpauth.rb