module Typetalk::Connection

Private Instance Methods

connection(options={}) click to toggle source
# File lib/typetalk/connection.rb, line 19
def connection(options={})
  options = {multipart:nil}.merge(options)

  Faraday.new(connection_options) do |builder|
    builder.request :multipart if options[:multipart]
    builder.request :url_encoded
    builder.adapter :net_http
  end
end
connection_options() click to toggle source
# File lib/typetalk/connection.rb, line 12
def connection_options
  {
    :headers => {'Accept' => 'application/json; charset=utf-8', 'User-Agent' => Typetalk.config.user_agent},
    :proxy => Typetalk.config.proxy,
  }
end
endpoint() click to toggle source
# File lib/typetalk/connection.rb, line 8
def endpoint
  Typetalk.config.endpoint
end