Class: Bigbank::Client::Endpoint
- Inherits:
-
Object
- Object
- Bigbank::Client::Endpoint
- Defined in:
- lib/bigbank/client/endpoint.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
18 19 20 |
# File 'lib/bigbank/client/endpoint.rb', line 18 def config Bigbank::Client.config end |
#connection ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bigbank/client/endpoint.rb', line 4 def connection @connection ||= ::Faraday.new(url: config.endpoint) do |builder| builder.use ::Faraday::Request::UrlEncoded builder.response :json, :content_type => /\bjson$/ builder.headers["User-Agent"] = user_agent builder.[:open_timeout] = config.open_timeout builder.[:timeout] = config.timeout builder.adapter config.adapter builder.ssl.verify = config.verify_ssl builder.proxy(config.proxy) if config.enable_proxy? end end |
#user_agent ⇒ Object
22 23 24 |
# File 'lib/bigbank/client/endpoint.rb', line 22 def user_agent "bigbank-client v#{::Bigbank::Client::VERSION} (github.com/mrtin/bigbank-client)" end |