Class: Mbta::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/mbta/connection.rb

Direct Known Subclasses

Request

Class Method Summary collapse

Class Method Details

.connectionObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/mbta/connection.rb', line 6

def self.connection
  @connection = begin
    Faraday.new(:url => Mbta::Config::BASE_URL, :params => { :api_key => Mbta.api_key, :format => Mbta.format }) do |c|
      c.request :url_encoded
      c.request :json
      c.response :json
      c.adapter Faraday.default_adapter
    end
  end
end