Skip to content

Instantly share code, notes, and snippets.

@eric
Created July 26, 2011 19:43
Show Gist options
  • Save eric/1107792 to your computer and use it in GitHub Desktop.
Save eric/1107792 to your computer and use it in GitHub Desktop.
class YourThing
def self.connection
@connection ||= Faraday::Connection.new do |b|
b.use Faraday::Request::UrlEncoded
# and all the rest
end
end
def connection
@connection ||= begin
c = self.class.connection.dup
c.params['user'] = 'something'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment