X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0561bd0c3c07257fd58ded6c7cfa5feeae97af57..a7631a1ccb6e2a6925d00a06562e171c4ce4ea2f:/doc/sdk/ruby/example.html.textile.liquid diff --git a/doc/sdk/ruby/example.html.textile.liquid b/doc/sdk/ruby/example.html.textile.liquid index 621b664fb6..f2ea1c09df 100644 --- a/doc/sdk/ruby/example.html.textile.liquid +++ b/doc/sdk/ruby/example.html.textile.liquid @@ -14,10 +14,10 @@ h2. Initialize SDK Import the module and set up an API client user agent: -
+{% codeblock as ruby %}
 require 'arvados'
 arv = Arvados.new(apiVersion: 'v1')
-
+{% 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. @@ -25,56 +25,57 @@ h2. create Create an object: -
+{% codeblock as ruby %}
 new_link = arv.link.create(link: {link_class: 'test', name: 'test'})
-
+{% endcodeblock %} h2. delete Delete an object: -
+{% codeblock as ruby %}
 arv.link.delete(uuid: new_link[:uuid])
-
+{% endcodeblock %} h2. get Retrieve an object by ID: -
+{% codeblock as ruby %}
 some_user = arv.user.get(uuid: current_user_uuid)
-
+{% endcodeblock %} h2. list Get a list of objects: -
+{% codeblock as ruby %}
 repos = arv.repository.list
 first_repo = repos[:items][0]
 puts "UUID of first repo returned is #{first_repo[:uuid]}"
-UUID of first repo returned is qr1hi-s0uqq-b1bnybpx3u5temz
-
+{% endcodeblock %} + +UUID of first repo returned is zzzzz-s0uqq-b1bnybpx3u5temz h2. update Update an object: -
+{% codeblock as ruby %}
 updated_link = arv.link.update(uuid: new_link[:uuid],
                                link: {properties: {foo: 'bar'}})
-
+{% endcodeblock %} h2. Get current user Get the User object for the current user: -
+{% codeblock as ruby %}
 current_user = arv.user.current
-
+{% endcodeblock %} Get the UUID of an object that was retrieved using the SDK: -
+{% codeblock as ruby %}
 current_user_uuid = current_user[:uuid]
-
+{% endcodeblock %}