Sha256: 1b21755bc559f03f776ce32bae4cf7485590fd531ffe02710f50e55150fe03dc
Contents?: true
Size: 855 Bytes
Versions: 1
Compression:
Stored size: 855 Bytes
Contents
require 'patron' module Animoto module HTTPEngines class PatronAdapter < Animoto::HTTPEngines::Base # @return [String] def request method, url, body = nil, headers = {}, options = {} session = build_session options response = session.request method, url, headers, :data => body check_response response.status, response.body response.body end private # Builds the Session object. # # @param [Hash{Symbol=>Object}] options options for the Session # @return [Patron::Session] the Session object def build_session options session = ::Patron::Session.new session.timeout = options[:timeout] session.username = options[:username] session.password = options[:password] session end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
animoto-1.0.0 | ./lib/animoto/http_engines/patron_adapter.rb |