-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathProperCase.JSONEncoder.html
115 lines (100 loc) · 4.93 KB
/
ProperCase.JSONEncoder.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<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.22.1">
<meta name="project" content="proper_case v1.3.1">
<title>ProperCase.JSONEncoder — proper_case v1.3.1</title>
<link rel="stylesheet" href="dist/elixir-e589b8fad3dab6230c65.css" />
<script src="dist/sidebar_items-91207318ba.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/app-5c0c23dfec2d63ae33a2.js"></script>
</head>
<body data-type="modules">
<script>try { if(localStorage.getItem('night-mode') === 'true') document.body.className += ' night-mode'; } catch (e) { }</script>
<div class="main">
<button class="sidebar-button sidebar-toggle">
<span class="icon-menu" title="Collapse/expand sidebar"></span>
</button>
<section class="sidebar">
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button">
<span class="icon-search" aria-hidden="true"></span>
</button>
<button type="button" tabindex="-1" class="search-close-button">
<span class="icon-cross" title="Cancel search"></span>
</button>
<label class="search-label">
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search..." aria-label="Search" autocomplete="off" />
</label>
</form>
<div class="autocomplete">
<div class="autocomplete-results">
</div>
</div>
<div class="sidebar-header">
<div class="sidebar-projectDetails">
<a href="api-reference.html" class="sidebar-projectName">
proper_case </a>
<h2 class="sidebar-projectVersion">
v1.3.1
</h2>
</div>
</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>
<div class="gradient"></div>
<ul id="full-list" class="sidebar-fullList"></ul>
</section>
<section class="content">
<div class="content-outer">
<div id="content" class="content-inner">
<h1>
<small class="app-vsn">proper_case v1.3.1</small>
ProperCase.JSONEncoder </h1>
<section id="moduledoc">
<p> module that exposes a version of <code class="inline">encode_to_iodata!/1</code> that transforms data
before encoding to json. This is designed to work with phoenix.</p><p> Options:
transform - artity 1 function that is executed before passing the result to json_encoder.encode_to_iodata!
json_encoder - JSON encoder that implements encode_to_iodata!. Default: Jason</p><p> usage:</p><pre><code class="nohighlight makeup elixir"><span class="kd">def</span><span class="w"> </span><span class="nc">MyApp.CustomJSONEncoder</span><span class="w"> </span><span class="k" data-group-id="3216298290-1">do</span><span class="w">
</span><span class="kn">use</span><span class="w"> </span><span class="nc">ProperCase.JSONEncoder</span><span class="p">,</span><span class="w"> </span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="o">&</span><span class="nc">ProperCase</span><span class="o">.</span><span class="n">to_camel_case</span><span class="o">/</span><span class="mi">1</span><span class="w">
</span><span class="k" data-group-id="3216298290-1">end</span><span class="w">
</span><span class="n">config</span><span class="o">.</span><span class="n">exs</span><span class="w">
</span><span class="ss">:phoenix</span><span class="p">,</span><span class="w"> </span><span class="ss">:format_encoders</span><span class="p">,</span><span class="w"> </span><span class="ss">json</span><span class="p">:</span><span class="w"> </span><span class="nc">MyApp.CustomJSONEncoder</span></code></pre> </section>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.22.1),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<p>
<button class="line footer-button display-shortcuts-help">
Display keyboard shortcuts
</button>
<button class="line footer-button night-mode-toggle">
Toggle night mode
</button>
<button class="line footer-button display-quick-switch">
Go to a HexDocs package
</button>
<button class="line footer-button tooltips-toggle">
<span class="tooltips-option-disable">Disable tooltips</span>
<span class="tooltips-option-enable">Enable tooltips</span>
</button>
</p>
</footer>
</div>
</div>
</section>
</div>
</body>
</html>