Repository URL to install this package:
|
Version:
0.3.1custom ▾
|
<!DOCTYPE html>
<html>
<head>
<title>http.rb</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="../../../docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To …</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page">
<a class="source" href="../../bcx.html">
lib/bcx.rb
</a>
<a class="source" href="http.html">
lib/bcx/client/http.rb
</a>
<a class="source" href="oauth.html">
lib/bcx/client/oauth.rb
</a>
<a class="source" href="../configuration.html">
lib/bcx/configuration.rb
</a>
<a class="source" href="../launchpad/oauth.html">
lib/bcx/launchpad/oauth.rb
</a>
<a class="source" href="../resources/access.html">
lib/bcx/resources/access.rb
</a>
<a class="source" href="../resources/authorization.html">
lib/bcx/resources/authorization.rb
</a>
<a class="source" href="../resources/person.html">
lib/bcx/resources/person.rb
</a>
<a class="source" href="../resources/project.html">
lib/bcx/resources/project.rb
</a>
<a class="source" href="../resources/todo.html">
lib/bcx/resources/todo.rb
</a>
<a class="source" href="../resources/todolist.html">
lib/bcx/resources/todolist.rb
</a>
<a class="source" href="../response_error.html">
lib/bcx/response_error.rb
</a>
<a class="source" href="../version.html">
lib/bcx/version.rb
</a>
</div>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>http.rb</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap for-h2">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<h2>HTTP Client</h2>
<p>Provides a client to access the Basecamp Next API using HTTP authentication</p>
<p>Example:</p>
<pre><code>client = <span class="constant">Bcx::Client::HTTP</span>.new(<span class="symbol">login:</span> <span class="string">'username'</span>, <span class="symbol">password:</span> <span class="string">'secret'</span>)</code></pre>
</div>
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
<span class="class"><span class="keyword">module</span> <span class="title">Client</span></span>
<span class="class"><span class="keyword">class</span> <span class="title">HTTP</span> <span class="inheritance">< <span class="parent">Rapidash::Client</span></span></span>
method <span class="symbol">:http</span>
extension <span class="symbol">:json</span>
encode_request_with <span class="symbol">:json</span>
raise_errors
resource <span class="symbol">:projects</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Project'</span>
resource <span class="symbol">:todolists</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Todolist'</span>
resource <span class="symbol">:people</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Person'</span>
<span class="function"><span class="keyword">def</span> <span class="title">initialize</span><span class="params">(options = {})</span></span>
<span class="variable">@account</span> = <span class="constant">Bcx</span>.configuration.account
<span class="variable">@api_version</span> = <span class="constant">Bcx</span>.configuration.api_version
<span class="keyword">self</span>.<span class="keyword">class</span>.site(<span class="string">"https://basecamp.com/<span class="subst">#{<span class="variable">@account</span>}</span>/api/<span class="subst">#{<span class="variable">@api_version</span>}</span>/"</span>)
<span class="keyword">super</span>(options)
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span></pre></div></div>
</li>
</ul>
</div>
</body>
</html>