Class: LinkedIn::Connection
- Inherits:
-
Faraday::Connection
- Object
- Faraday::Connection
- LinkedIn::Connection
- Defined in:
- lib/linked_in/connection.rb
Overview
Used to perform requests against LinkedIn’s API.
Instance Method Summary collapse
-
#initialize(url = nil, options = nil, &block) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(url = nil, options = nil, &block) ⇒ Connection
Returns a new instance of Connection.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/linked_in/connection.rb', line 5 def initialize(url=nil, =nil, &block) if url.is_a? Hash = url url = [:url] end url = default_url if url.nil? super url, , &block # We need to use the FlatParamsEncoder so we can pass multiple of # the same param to certain endpoints (like the search API). self..params_encoder = ::Faraday::FlatParamsEncoder middleware = Faraday::RackBuilder::Handler.new(LinkedIn::RaiseError) self.builder.handlers.push(middleware) end |