Merge branch '15964-fix-docs' refs #15964
[arvados.git] / doc / sdk / ruby / example.html.textile.liquid
index 409a70a8130fe83b1aefe6b4eb381da7bb4f7200..f2ea1c09dfd6b9f8f0c4433e1b1e649cac66631f 100644 (file)
@@ -4,15 +4,20 @@ navsection: sdk
 navmenu: Python
 title: Examples
 ...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
 
 h2.  Initialize SDK
 
 Import the module and set up an API client user agent:
 
-<pre>
+{% codeblock as ruby %}
 require 'arvados'
 arv = Arvados.new(apiVersion: 'v1')
-</pre>
+{% endcodeblock %}
 
 The SDK retrieves the list of API methods from the server at run time. Therefore, the set of available methods is determined by the server version rather than the SDK version.
 
@@ -20,56 +25,57 @@ h2. create
 
 Create an object:
 
-<pre>
+{% codeblock as ruby %}
 new_link = arv.link.create(link: {link_class: 'test', name: 'test'})
-</pre>
+{% endcodeblock %}
 
 h2. delete
 
 Delete an object:
 
-<pre>
+{% codeblock as ruby %}
 arv.link.delete(uuid: new_link[:uuid])
-</pre>
+{% endcodeblock %}
 
 h2. get
 
 Retrieve an object by ID:
 
-<pre>
+{% codeblock as ruby %}
 some_user = arv.user.get(uuid: current_user_uuid)
-</pre>
+{% endcodeblock %}
 
 h2. list
 
 Get a list of objects:
 
-<pre>
+{% codeblock as ruby %}
 repos = arv.repository.list
 first_repo = repos[:items][0]
 puts "UUID of first repo returned is #{first_repo[:uuid]}"</code>
-UUID of first repo returned is qr1hi-s0uqq-b1bnybpx3u5temz
-</pre>
+{% endcodeblock %}
+
+UUID of first repo returned is zzzzz-s0uqq-b1bnybpx3u5temz
 
 h2. update
 
 Update an object:
 
-<pre>
+{% codeblock as ruby %}
 updated_link = arv.link.update(uuid: new_link[:uuid],
                                link: {properties: {foo: 'bar'}})
-</pre>
+{% endcodeblock %}
 
 h2. Get current user
 
 Get the User object for the current user:
 
-<pre>
+{% codeblock as ruby %}
 current_user = arv.user.current
-</pre>
+{% endcodeblock %}
 
 Get the UUID of an object that was retrieved using the SDK:
 
-<pre>
+{% codeblock as ruby %}
 current_user_uuid = current_user[:uuid]
-</pre>
+{% endcodeblock %}