Module: Evrythng::Client::Collections

Included in:
Evrythng::Client
Defined in:
lib/evrythng/client/collections.rb

Overview

Defines methods related to collections

Instance Method Summary collapse

Instance Method Details

#collection_create(name, description = nil, options = {}) ⇒ Hash

Creates a collection

Examples:

Create the authenticating user’s collection

Evrythng.collection_create("This is a new collection!", "Here comes the description.")

Parameters:

  • name (String)

    The name of collection.

  • description (String) (defaults to: nil)

    The description of collection.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

    The created collection.

See Also:



25
26
27
# File 'lib/evrythng/client/collections.rb', line 25

def collection_create(name, description=nil, options={})
  post('collections', options.merge(:name => name, :description => description))
end

#collections(options = {}) ⇒ Array

Returns a list of collections

Examples:

Return the list of collections

Evrythng.collections

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Array)

    The requested list of collections.

See Also:



12
13
14
# File 'lib/evrythng/client/collections.rb', line 12

def collections(options={})
  get('collections', options)
end