Methods

Not all ruby public instance methods are available. Methods are whitelisted to ensure security. The Workato SDK Framework also exposes some methods to make building SDKs convenient.

REST verb methods

These methods are synonymous to HTTP verbs (GET, POST, PUT, PATCH AND DELETE). These methods are provide you with a very easy way to build and execute HTTP requests without having to think about other details like timeouts, HTTP connection, streaming etc.

Learn how to make HTTP requests using the HTTP verb methods here.

Ruby methods

Method Description
each Basic iterator
[1, 2, 3].each { |i| puts i }
group_by Group arrays into sets.
More details here
headers Add headers to a request
.headers(Authorization: "Bearer HTB674HJK1")
params Add parameter to a request
.params(api_key: "HTB674HJK1")
payload Add payload to a request
.payload(id: "345")
ignored Ignore a comma-separate list of fields
object_definition["user"].ignored("id", "created_at")
only White list a comma-separate of fields
object_definition["user"].only("id", "name")
required Make a comma-separate list of fields required
object_definition["user"].required("id", "created_at")
inject Combine elements in an array using an operation.
More details here
iso8601 Convert a date/date-time variable to ISO8601 format
map Returns a new array after invoking block on each element
merge Returns a new hash containing merged contents.
More details here
pluck Select one or more attributes from an array of objects
[
  {"id": 1, "name": "David"},
  {"id": 2, "name": "Peter"}
].pluck("id")
returns [1, 2]
rand Random number between 0 and 1
select Selectively returns elements for which the block returns true.
More details here
reject Selectively returns elements for which the block returns false. Similar but opposite of select.
More details here
sort Sort function returning new sorted array.
More details here
sort_by Sort function returning self.
More details here
utc Convert Time to UTC timezone.
More details here
puts ruby version of console.log or stdout, not the same as put method
while while loop statement.
More details here

This list can and will be expanded constantly, feel free to contact us to update/add to this list.

Workato also supports custom reusable methods. See Reusable Methods for more information.

results matching ""

    No results matching ""