Sha256: dba0812a80105212d6ca6f03385e961da4c0a6aed7dd9da4aff42f406ecea64e
Contents?: true
Size: 818 Bytes
Versions: 1
Compression:
Stored size: 818 Bytes
Contents
require 'faraday' require 'faraday_middleware' module ZenhubRuby module Connection END_POINT = 'https://api.zenhub.io'.freeze def get(path) api_connection.get(path) end private def api_connection @api_connection ||= Faraday::Connection.new(END_POINT, connect_options) end def connect_options @connect_options ||= { builder: middleware, headers: { accept: 'application/json', user_agent: "ZenhubRuby v#{VERSION}", x_authentication_token: zenhub_access_token } } end def middleware @middleware ||= Faraday::RackBuilder.new do |builder| builder.request :url_encoded builder.adapter :net_http builder.response :json, content_type: /\bjson$/ end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
zenhub_ruby-0.2.1 | lib/zenhub_ruby/connection.rb |