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