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 collection object.



36
37
38
# File 'lib/behance/collections.rb', line 36

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 with 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.
:sort     - The order the results are returned in.
            Possible values: featured_date (default),
            appreciations, views, comments, published_date,
            followed.
:per_page - The number of results per page. (Max: 20)

Examples

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

Returns an array of projects from a collection in JSON format.



61
62
63
# File 'lib/behance/collections.rb', line 61

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

#collections(options = {}) ⇒ Object

Public: Search for collections.

options - The Hash with 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.



23
24
25
# File 'lib/behance/collections.rb', line 23

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