examples/api-samples/public/docs/sample01.html in groupdocs-1.5.8 vs examples/api-samples/public/docs/sample01.html in groupdocs-1.5.9

- old
+ new

@@ -65,23 +65,42 @@ <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>] set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>] set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>] - <span class="keyword">begin</span> - - <span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div> + <span class="keyword">begin</span></pre></div></div> </li> <li id="section-4"> <div class="annotation"> <div class="pilwrap "> <a class="pilcrow" href="#section-4">&#182;</a> </div> + <p>Prepare base path</p> + + </div> + + <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty? + base_path = <span class="string">'https://api.groupdocs.com'</span> + <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>) + base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>] + <span class="keyword">else</span> + base_path = settings.base_path + <span class="keyword">end</span></pre></div></div> + + </li> + + + <li id="section-5"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-5">&#182;</a> + </div> <p>Configure your access to API server</p> </div> <div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs| @@ -89,48 +108,48 @@ groupdocs.private_key = settings.private_key</pre></div></div> </li> - <li id="section-5"> + <li id="section-6"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-5">&#182;</a> + <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Optionally specify API server and version</p> </div> - <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span> + <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div> </li> - <li id="section-6"> + <li id="section-7"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-6">&#182;</a> + <a class="pilcrow" href="#section-7">&#182;</a> </div> - <p>check required variables</p> + <p>Check required variables</p> </div> <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?</pre></div></div> </li> - <li id="section-7"> + <li id="section-8"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-7">&#182;</a> + <a class="pilcrow" href="#section-8">&#182;</a> </div> - <p>make a request to API using client_id and private_key</p> + <p>Make a request to API using client_id and private_key</p> </div> <div class="content"><div class='highlight'><pre> user = <span class="constant">GroupDocs::User</span>.get!() @@ -139,16 +158,16 @@ <span class="keyword">end</span></pre></div></div> </li> - <li id="section-8"> + <li id="section-9"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-8">&#182;</a> + <a class="pilcrow" href="#section-9">&#182;</a> </div> - <p>set variables for template</p> + <p>Set variables for template</p> </div> <div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample01</span>, <span class="symbol">:locals</span> =&gt; {<span class="symbol">:userId</span> =&gt; settings.client_id, <span class="symbol">:privateKey</span> =&gt; settings.private_key, <span class="symbol">:user</span> =&gt; user, <span class="symbol">:err</span> =&gt; err} <span class="keyword">end</span></pre></div></div>