Method: Orchestrate::Client#put_relation

Defined in:
lib/orchestrate/client.rb

#put_relation(collection, key, kind, to_collection, to_key) ⇒ Object

Creates a relationship between two Key/Value objects. Relations can span collections.

Parameters:

  • collection (#to_s)

    The name of the collection.

  • key (#to_s)

    The name of the key.

  • kind (#to_s)

    The kind of relationship to create.

  • to_collection (#to_s)

    The name of the collection to relate to.

  • to_key (#to_s)

    The name of the key to relate to.

Returns:

  • Orchestrate::API::Response

Raises:

  • Orchestrate::API::NotFound If either end of the relation doesn't exist.


386
387
388
# File 'lib/orchestrate/client.rb', line 386

def put_relation(collection, key, kind, to_collection, to_key)
  send_request :put, [collection, key, 'relation', kind, to_collection, to_key], { body: {} }
end