-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7d29a9
commit 1f89a5f
Showing
25 changed files
with
2,098 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \\ "// 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: \"<%= scheme %>://<%= host %>\",\n namespace: \"<%= path %>\",\n token: Ember.computed.alias('accessTokenWrapper.token'),\n <%= path_for_type %>\n headers: function() {\n return {\n 'AUTHORIZATION': 'Bearer ' + this.get('token')\n };\n }.property('token')\n});\n")</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 \\ "// 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: \"<%= scheme %>://<%= host %>\",\n namespace: \"<%= path %>\",\n token: Ember.computed.alias('accessTokenWrapper.token'),\n <%= path_for_type %>\n headers: function() {\n return {\n 'AUTHORIZATION': 'Bearer ' + this.get('token')\n };\n }.property('token')\n});\n")</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 > resource = %Braise.Resource{definitions: %{"patients" =>{}}, | ||
links: [%{"href" => "http://bizdev.biz/api/v1"}]} | ||
iex > Braise.AdapterTemplate.generate_from_resource(resource) | ||
{:ok, | ||
"import DS from 'ember-data';</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: "/api/v1",</code></pre> | ||
<p> token: Ember.computed.alias(‘accessTokenWrapper.token’),</p> | ||
<pre><code class="elixir"> headers: function() { | ||
return { | ||
'AUTHORIZATION': 'Bearer ' + this.get('token'); | ||
|
||
};</code></pre> | ||
<p> }.property(‘token’) | ||
}); | ||
“</p> | ||
<pre><code class="elixir">} | ||
|
||
iex > Braise.AdapterTemplate.generate_from_resource(%{}) | ||
{:error, "Invalid JSON Schema"} | ||
|
||
iex > Braise.AdapterTemplate.generate_from_resource(%Braise.Resource{definitions: %{"patients" => {}}, links: "Pirate Booty"}) | ||
{:error, "Invalid links portion of JSON Schema"} | ||
|
||
iex > Braise.AdapterTemplate.generate_From_resource(%Braise.Resource{definitions: "Pirate Booty", links: [%{"href" => "http://piratebooty.biz/"}]) | ||
{:error, "Invalid definitions portion of JSON Schema"}</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 > template = “<%= path_for_type %>” | ||
iex > Braise.AdapterTemplate.replace_path_for_type_variable(template, “patient”) | ||
“” | ||
iex > 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 > template = “<%= scheme %> <%= host %> <%= path %>” | ||
iex > 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> | ||
|
Oops, something went wrong.