Method: Trello.http_client

Defined in:
lib/trello.rb

.http_clientObject



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/trello.rb', line 131

def self.http_client
  @http_client ||= begin
    # No client has been set explicitly. Try to load each supported client.
    # The first one that loads successfully will be used.
    client = HTTP_CLIENT_PRIORITY.each do |key|
      begin
        require key
        break HTTP_CLIENTS[key]
      rescue LoadError
        next
      end
    end

    raise ConfigurationError, 'Trello requires either faraday or rest-client installed' unless client

    client
  end
end