class Bigbank::Client::Endpoint

Public Instance Methods

config() click to toggle source
# File lib/bigbank/client/endpoint.rb, line 18
def config
  Bigbank::Client.config
end
connection() click to toggle source
# 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.options[:open_timeout] = config.open_timeout
      builder.options[: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() click to toggle source
# File lib/bigbank/client/endpoint.rb, line 22
def user_agent
  "bigbank-client v#{::Bigbank::Client::VERSION} (github.com/mrtin/bigbank-client)"
end