Skip to content

Commit

Permalink
Add documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksrobertson committed Jan 11, 2016
1 parent c7d29a9 commit 1f89a5f
Show file tree
Hide file tree
Showing 25 changed files with 2,098 additions and 30 deletions.
87 changes: 87 additions & 0 deletions doc/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.11.3">
<title>404 – braise v0.1.0</title>
<link rel="stylesheet" href="dist/app-ddd9717ad9.css" />
<script src="dist/sidebar_items.js"></script>
</head>
<body data-type="extras">

<div class="main">
<button class="sidebar-toggle">
<i class="icon-menu"></i>
</button>
<section class="sidebar">
<button class="sidebar-toggle">
<i class="icon-menu"></i>
</button>


<a href="api-reference.html" class="sidebar-projectLink">
<div class="sidebar-projectDetails">
<h1 class="sidebar-projectName">
braise
</h1>
<h2 class="sidebar-projectVersion">
v0.1.0
</h2>
</div>

</a>

<div class="sidebar-search">
<i class="icon-search"></i>
<input type="text" class="sidebar-searchInput" placeholder="search" autocomplete="off" />
</div>

<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>


<li><a id="modules-list" href="#full-list">Modules</a></li>





</ul>

<ul id="full-list" class="sidebar-fullList"></ul>
<div class="sidebar-noResults"></div>
</section>

<section class="content">
<div id="content" class="content-inner">


<h2>Page not found</h2>

<p>Sorry, but the page you were trying to get to, does not exist. You
may want to try searching this site using the sidebar or using our
<a href="api-reference.html" title="API Reference">API Reference</a> page to find what
you were looking for.</p>

<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" rel="help" target="_blank">ExDoc</a> (v0.11.3),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<button class="night-mode-toggle" />
</footer>
</div>
</section>
</div>
<script src="dist/app-6d2e071366.js"></script>
</body>
</html>

277 changes: 277 additions & 0 deletions doc/Braise.AdapterTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.11.3">
<title>Braise.AdapterTemplate – braise v0.1.0</title>
<link rel="stylesheet" href="dist/app-ddd9717ad9.css" />
<script src="dist/sidebar_items.js"></script>
</head>
<body data-type="modules">

<div class="main">
<button class="sidebar-toggle">
<i class="icon-menu"></i>
</button>
<section class="sidebar">
<button class="sidebar-toggle">
<i class="icon-menu"></i>
</button>


<a href="api-reference.html" class="sidebar-projectLink">
<div class="sidebar-projectDetails">
<h1 class="sidebar-projectName">
braise
</h1>
<h2 class="sidebar-projectVersion">
v0.1.0
</h2>
</div>

</a>

<div class="sidebar-search">
<i class="icon-search"></i>
<input type="text" class="sidebar-searchInput" placeholder="search" autocomplete="off" />
</div>

<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>


<li><a id="modules-list" href="#full-list">Modules</a></li>





</ul>

<ul id="full-list" class="sidebar-fullList"></ul>
<div class="sidebar-noResults"></div>
</section>

<section class="content">
<div id="content" class="content-inner">


<h1>
<small class="visible-xs">braise v0.1.0</small>
Braise.AdapterTemplate


</h1>


<section id="moduledoc" class="docstring">
<p>Constructs a string representation of an Ember-CLI Adapter
given the passed in JSON Schema Resource.</p>

</section>



<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<i class="icon-link"></i>
</a>
Summary
</h1>



<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#generate_from_resource/2">generate_from_resource(resource, template_string \\ &quot;// DO NOT EDIT - this file was autogenerated by Braise\nimport DS from 'ember-data';\nimport Ember from 'ember';\n\nexport default DS.RESTAdapter.extend({\n host: \&quot;&lt;%= scheme %&gt;://&lt;%= host %&gt;\&quot;,\n namespace: \&quot;&lt;%= path %&gt;\&quot;,\n token: Ember.computed.alias('accessTokenWrapper.token'),\n &lt;%= path_for_type %&gt;\n headers: function() {\n return {\n 'AUTHORIZATION': 'Bearer ' + this.get('token')\n };\n }.property('token')\n});\n&quot;)</a>
</div>

<div class="summary-synopsis"><p>Returns a tuple that contains either a string representation of the adapter
or an error message</p>
</div>

</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#replace_path_for_type_variable/2">replace_path_for_type_variable(template, resource_name)</a>
</div>

<div class="summary-synopsis"><p>Replaces the path_for_type template variable if it is the passed in resource_name
is a snake case representation of multiple words. If it is one word, it replaces
with nothing</p>
</div>

</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#replace_template_variables/2">replace_template_variables(template_string, resource)</a>
</div>

</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#replace_uri_variables/2">replace_uri_variables(template, arg2)</a>
</div>

<div class="summary-synopsis"><p>Replaces the scheme, host and path template variables with the representations
from the Braise.Resource.url</p>
</div>

</div>

</div>






</section>





<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<i class="icon-link"></i>
</a>
Functions
</h1>
<div class="detail" id="generate_from_resource/2">
<div class="detail-header">
<a href="#generate_from_resource/2" class="detail-link" title="Link to this function">
<i class="icon-link"></i>
</a>
<span class="signature">generate_from_resource(resource, template_string \\ &quot;// DO NOT EDIT - this file was autogenerated by Braise\nimport DS from 'ember-data';\nimport Ember from 'ember';\n\nexport default DS.RESTAdapter.extend({\n host: \&quot;&lt;%= scheme %&gt;://&lt;%= host %&gt;\&quot;,\n namespace: \&quot;&lt;%= path %&gt;\&quot;,\n token: Ember.computed.alias('accessTokenWrapper.token'),\n &lt;%= path_for_type %&gt;\n headers: function() {\n return {\n 'AUTHORIZATION': 'Bearer ' + this.get('token')\n };\n }.property('token')\n});\n&quot;)</span>

</div>

<section class="docstring">
<p>Returns a tuple that contains either a string representation of the adapter
or an error message.</p>
<h2>Examples</h2>
<pre><code class="elixir">iex &gt; resource = %Braise.Resource{definitions: %{&quot;patients&quot; =&gt;{}},
links: [%{&quot;href&quot; =&gt; &quot;http://bizdev.biz/api/v1&quot;}]}
iex &gt; Braise.AdapterTemplate.generate_from_resource(resource)
{:ok,
&quot;import DS from &#39;ember-data&#39;;</code></pre>
<p>import Ember from ‘ember’;</p>
<p>export default DS.RESTAdapter.extend({
host: “<a href="http://bizdev.biz">http://bizdev.biz</a>”,</p>
<pre><code class="elixir"> namespace: &quot;/api/v1&quot;,</code></pre>
<p> token: Ember.computed.alias(‘accessTokenWrapper.token’),</p>
<pre><code class="elixir"> headers: function() {
return {
&#39;AUTHORIZATION&#39;: &#39;Bearer &#39; + this.get(&#39;token&#39;);

};</code></pre>
<p> }.property(‘token’)
});
</p>
<pre><code class="elixir">}

iex &gt; Braise.AdapterTemplate.generate_from_resource(%{})
{:error, &quot;Invalid JSON Schema&quot;}

iex &gt; Braise.AdapterTemplate.generate_from_resource(%Braise.Resource{definitions: %{&quot;patients&quot; =&gt; {}}, links: &quot;Pirate Booty&quot;})
{:error, &quot;Invalid links portion of JSON Schema&quot;}

iex &gt; Braise.AdapterTemplate.generate_From_resource(%Braise.Resource{definitions: &quot;Pirate Booty&quot;, links: [%{&quot;href&quot; =&gt; &quot;http://piratebooty.biz/&quot;}])
{:error, &quot;Invalid definitions portion of JSON Schema&quot;}</code></pre>

</section>
</div>
<div class="detail" id="replace_path_for_type_variable/2">
<div class="detail-header">
<a href="#replace_path_for_type_variable/2" class="detail-link" title="Link to this function">
<i class="icon-link"></i>
</a>
<span class="signature">replace_path_for_type_variable(template, resource_name)</span>

</div>

<section class="docstring">
<p>Replaces the path_for_type template variable if it is the passed in resource_name
is a snake case representation of multiple words. If it is one word, it replaces
with nothing.</p>
<h2>Examples</h2>
<p> iex &gt; template = “&lt;%= path_for_type %&gt;”
iex &gt; Braise.AdapterTemplate.replace_path_for_type_variable(template, “patient”)
“”
iex &gt; Braise.AdapterTemplate.replace_path_for_type_variable(template, “staff_members”)
“pathForType: function(type) {
var decamelized = Ember.String.decamelize(type);
return Ember.String.pluralize(decamelized);
},
</p>

</section>
</div>
<div class="detail" id="replace_template_variables/2">
<div class="detail-header">
<a href="#replace_template_variables/2" class="detail-link" title="Link to this function">
<i class="icon-link"></i>
</a>
<span class="signature">replace_template_variables(template_string, resource)</span>

</div>

<section class="docstring">

</section>
</div>
<div class="detail" id="replace_uri_variables/2">
<div class="detail-header">
<a href="#replace_uri_variables/2" class="detail-link" title="Link to this function">
<i class="icon-link"></i>
</a>
<span class="signature">replace_uri_variables(template, arg2)</span>

</div>

<section class="docstring">
<p>Replaces the scheme, host and path template variables with the representations
from the Braise.Resource.url</p>
<h2>Examples</h2>
<p> iex &gt; template = “&lt;%= scheme %&gt; &lt;%= host %&gt; &lt;%= path %&gt;”
iex &gt; Braise.AdapterTemplate.replace_uri_variables(template, URI.parse(“<a href="http://bizdev.com/api">http://bizdev.com/api</a>”))
“http bizdev.com /api”</p>

</section>
</div>

</section>





<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" rel="help" target="_blank">ExDoc</a> (v0.11.3),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<button class="night-mode-toggle" />
</footer>
</div>
</section>
</div>
<script src="dist/app-6d2e071366.js"></script>
</body>
</html>

0 comments on commit 1f89a5f

Please sign in to comment.