examples/api-samples/public/docs/sample11.html in groupdocs-1.5.0 vs examples/api-samples/public/docs/sample11.html in groupdocs-1.5.1
- old
+ new
@@ -1,6 +1,6 @@
-<!DOCTYPE html> <html> <head> <title>sample11.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample11.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">'/sample11'</span> <span class="k">do</span>
+<!DOCTYPE html> <html> <head> <title>sample11.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample11.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">'/sample11'</span> <span class="k">do</span>
<span class="n">haml</span> <span class="ss">:sample11</span>
<span class="k">end</span>
</pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>POST request</p> </td> <td class="code"> <div class="highlight"><pre>
<span class="n">post</span> <span class="s1">'/sample11'</span> <span class="k">do</span>
@@ -10,32 +10,32 @@
<span class="n">set</span> <span class="ss">:file_id</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:fileId</span><span class="o">]</span>
<span class="n">set</span> <span class="ss">:annotation_type</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:annotation_type</span><span class="o">]</span>
<span class="k">begin</span>
</pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">¶</a> </div> <p>check required variables</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="k">raise</span> <span class="s2">"Please enter all required parameters"</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="o">.</span><span class="n">empty?</span>
+ <span class="k">raise</span> <span class="s1">'Please enter all required parameters'</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="o">.</span><span class="n">empty?</span>
</pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">¶</a> </div> <p>annotation types</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="n">types</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'text'</span> <span class="o">=></span> <span class="mi">0</span><span class="p">,</span> <span class="s1">'area'</span> <span class="o">=></span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'point'</span> <span class="o">=></span> <span class="mi">2</span><span class="p">}</span>
+ <span class="n">types</span> <span class="o">=</span> <span class="p">{</span><span class="ss">:text</span> <span class="o">=></span> <span class="mi">0</span><span class="p">,</span> <span class="ss">:area</span> <span class="o">=></span> <span class="mi">1</span><span class="p">,</span> <span class="ss">:point</span> <span class="o">=></span> <span class="mi">2</span><span class="p">}</span>
</pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">¶</a> </div> <p>required parameters</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="n">allParams</span> <span class="o">=</span> <span class="n">allParams</span> <span class="o">=</span> <span class="o">[</span><span class="s1">'annotation_type'</span><span class="p">,</span> <span class="s1">'box_x'</span><span class="p">,</span> <span class="s1">'box_y'</span><span class="p">,</span> <span class="s1">'text'</span><span class="o">]</span>
+ <span class="n">all_params</span> <span class="o">=</span> <span class="n">all_params</span> <span class="o">=</span> <span class="o">[</span><span class="s1">'annotation_type'</span><span class="p">,</span> <span class="s1">'box_x'</span><span class="p">,</span> <span class="s1">'box_y'</span><span class="p">,</span> <span class="s1">'text'</span><span class="o">]</span>
</pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">¶</a> </div> <p>added required parameters depends on annotation type ['text' or 'area']</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">"text"</span>
- <span class="n">allParams</span> <span class="o">=</span> <span class="n">allParams</span> <span class="o">|</span> <span class="o">[</span><span class="s1">'box_width'</span><span class="p">,</span> <span class="s1">'box_height'</span><span class="p">,</span> <span class="s1">'annotationPosition_x'</span><span class="p">,</span> <span class="s1">'annotationPosition_y'</span><span class="o">]</span>
- <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">"area"</span>
- <span class="n">allParams</span> <span class="o">=</span> <span class="n">allParams</span> <span class="o">|</span> <span class="o">[</span><span class="s1">'box_width'</span><span class="p">,</span> <span class="s1">'box_height'</span><span class="o">]</span>
+ <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">'text'</span>
+ <span class="n">all_params</span> <span class="o">=</span> <span class="n">all_params</span> <span class="o">|</span> <span class="o">[</span><span class="s1">'box_width'</span><span class="p">,</span> <span class="s1">'box_height'</span><span class="p">,</span> <span class="s1">'annotationPosition_x'</span><span class="p">,</span> <span class="s1">'annotationPosition_y'</span><span class="o">]</span>
+ <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">'area'</span>
+ <span class="n">all_params</span> <span class="o">=</span> <span class="n">all_params</span> <span class="o">|</span> <span class="o">[</span><span class="s1">'box_width'</span><span class="p">,</span> <span class="s1">'box_height'</span><span class="o">]</span>
<span class="k">end</span>
</pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">¶</a> </div> <p>checking required parameters</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="n">allParams</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">param</span><span class="o">|</span>
- <span class="k">raise</span> <span class="s2">"Please enter all required parameters"</span> <span class="k">if</span> <span class="n">params</span><span class="o">[</span><span class="n">param</span><span class="o">].</span><span class="n">empty?</span>
+ <span class="n">all_params</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">param</span><span class="o">|</span>
+ <span class="k">raise</span> <span class="s1">'Please enter all required parameters'</span> <span class="k">if</span> <span class="n">params</span><span class="o">[</span><span class="n">param</span><span class="o">].</span><span class="n">empty?</span>
<span class="k">end</span>
</pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">¶</a> </div> <p>make a request to API using client<em>id and private</em>key</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">'/'</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
+ <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">'/'</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
<span class="n">document</span> <span class="o">=</span> <span class="s1">''</span>
</pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">¶</a> </div> <p>get document by file ID</p> </td> <td class="code"> <div class="highlight"><pre>
<span class="n">files_list</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">element</span><span class="o">|</span>
<span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">respond_to?</span><span class="p">(</span><span class="s1">'guid'</span><span class="p">)</span> <span class="o">==</span> <span class="kp">true</span> <span class="ow">and</span> <span class="n">element</span><span class="o">.</span><span class="n">guid</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span>
@@ -49,39 +49,39 @@
<span class="n">annotation</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Document</span><span class="o">::</span><span class="no">Annotation</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">document</span><span class="p">:</span> <span class="n">document</span><span class="o">.</span><span class="n">to_document</span><span class="p">)</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="n">types</span><span class="o">[</span><span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="o">]</span>
</pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">¶</a> </div> <p>construct requestBody depends on annotation type
text annotation</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">"text"</span>
+ <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">'text'</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">box</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_x'</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_y'</span><span class="o">]</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_width'</span><span class="o">]</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_height'</span><span class="o">]</span><span class="p">}</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">annotationPosition</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'annotationPosition_x'</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'annotationPosition_y'</span><span class="o">]</span><span class="p">}</span>
</pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">¶</a> </div> <p>area annotation</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">"area"</span>
+ <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">'area'</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">box</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_x'</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_y'</span><span class="o">]</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_width'</span><span class="o">]</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_height'</span><span class="o">]</span><span class="p">}</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">annotationPosition</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
</pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">¶</a> </div> <p>point annotation</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">"point"</span>
+ <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">'point'</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">box</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_x'</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">'box_y'</span><span class="o">]</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
<span class="n">annotation</span><span class="o">.</span><span class="n">annotationPosition</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
<span class="k">end</span>
</pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">¶</a> </div> <p>call create method</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="n">annotation</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span> <span class="ss">:client_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
+ <span class="n">annotation</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
</pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">¶</a> </div> <p>add annotation reply</p> </td> <td class="code"> <div class="highlight"><pre>
<span class="n">reply</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Document</span><span class="o">::</span><span class="ss">Annotation</span><span class="p">:</span><span class="ss">:Reply</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">annotation</span><span class="p">:</span> <span class="n">annotation</span><span class="p">)</span>
<span class="n">reply</span><span class="o">.</span><span class="n">text</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="s1">'text'</span><span class="o">]</span>
- <span class="n">reply</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span> <span class="ss">:client_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
+ <span class="n">reply</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
<span class="k">end</span>
<span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=></span> <span class="n">e</span>
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
<span class="k">end</span>
</pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">¶</a> </div> <p>set variables for template</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="n">haml</span> <span class="ss">:sample11</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span> <span class="ss">:userId</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:fileId</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:annotationType</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="p">,</span> <span class="ss">:annotationId</span> <span class="o">=></span> <span class="p">(</span><span class="n">defined?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span><span class="p">)</span> <span class="p">?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span> <span class="p">:</span> <span class="kp">nil</span><span class="p">,</span> <span class="ss">:annotationText</span> <span class="o">=></span> <span class="n">params</span><span class="o">[</span><span class="s1">'text'</span><span class="o">]</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span> <span class="p">}</span>
+ <span class="n">haml</span> <span class="ss">:sample11</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:fileId</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:annotationType</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="p">,</span> <span class="ss">:annotationId</span> <span class="o">=></span> <span class="p">(</span><span class="n">defined?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span><span class="p">)</span> <span class="p">?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span> <span class="p">:</span> <span class="kp">nil</span><span class="p">,</span> <span class="ss">:annotationText</span> <span class="o">=></span> <span class="n">params</span><span class="o">[</span><span class="s1">'text'</span><span class="o">]</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
<span class="k">end</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
\ No newline at end of file