Sha256: dd537490c098f0c0036692d3a88ba8a24153d9f071ed88dabd6b3855a07a2cc9
Contents?: true
Size: 741 Bytes
Versions: 41
Compression:
Stored size: 741 Bytes
Contents
module Twitter class HTTPAuth include HTTParty format :plain attr_reader :username, :password, :options def initialize(username, password, options={}) @username, @password = username, password @options = {:ssl => false}.merge(options) self.class.base_uri "http#{'s' if options[:ssl]}://twitter.com" 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
41 entries across 41 versions & 17 rubygems