Module: Behance::Client::Collections

Included in:
Behance::Client
Defined in:
lib/behance/collections.rb

Instance Method Summary collapse

Instance Method Details

#collection(collection) ⇒ Object

Public: Get basic information about a collection.

collection - it has to be an ID (Integer).

Examples

@client.collection(1)

Returns a single user object.



34
35
36
# File 'lib/behance/collections.rb', line 34

def collection(collection)
  request("collections/#{collection}")["collection"]
end

#collection_projects(collection, options = {}) ⇒ Object

Public: Get projects from a collection.

collection - it has to be an ID (Integer). options - The Hash of options that the API would expect:

:time - Limits the search by time. 
        Possible values: all (default), today, week, month.
:page - The page number of the results, always starting 
        with 1.

Examples

@client.collections_projects(1)
@client.collections_projects(1, page: 2)

Returns an array of projects published an user in JSON format.



53
54
55
# File 'lib/behance/collections.rb', line 53

def collection_projects(collection, options={})
  request("collections/#{collection}/projects", options)["projects"]
end

#collections(options = {}) ⇒ Object

Public: Search for collections.

options - The Hash of options that the API would expect:

:q       - Free text query string.
:time    - Limits the search by time. Possible values: all (default), today, week, month.
:page    - The page number of the results, always starting
           with 1.
:sort    - The order the results are returned in. 
           Possible values: comments (default), views, last_item_added_date.

Examples

@client.collections
@client.collections(q: "candy", time: "month")

Returns an array of colelctions in JSON format.



21
22
23
# File 'lib/behance/collections.rb', line 21

def collections(options={})
  request("collections", options)["collections"]
end