Module: Behance::Client::Project

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

Instance Method Summary collapse

Instance Method Details

#project(project_id) ⇒ Object

Public: Get the information and content of a project.

project_id - the ID (Integer) of the project.

Examples

@client.project(1123)

Returns a single project in JSON format.



46
47
48
# File 'lib/behance/project.rb', line 46

def project(project_id)
  request("projects/#{project_id}")["project"]
end

#project_comments(project_id, options = {}) ⇒ Object

Public: Get the comments for a project

project_id - The ID (Integer) of the project. options - The Hash of options that the API would expect:

:page - The page number of the results, always 
starting with 1.

Examples

@client.project_comments(1)
@client.project_comments(1, page: 1)

Returns an array of project comments in JSON format.



63
64
65
# File 'lib/behance/project.rb', line 63

def project_comments(project_id, options={})
  request("projects/#{project_id}/comments", options)["comments"] 
end

#projects(options = {}) ⇒ Object

Public: Search for projects.

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

:q       - Free text query string.
:sort    - The order the results are returned in. 
           Possible values: featured_date (default), apprecia-
           tions, views, comments, 
           published_date.
:time    - Limits the search by time. 
           Possible values: all (default), today, week, month.
:field   - Limits the search by creative field. 
           Accepts a URL-encoded field name from the list of 
           defined creative fields.
:country - Limits the search by a 2-letter FIPS country code.
:state   - Limits the search by state or province name.
:city    - Limits the search by city name.
:page    - The page number of the results, always starting 
           with 1.
:tags    - Limits the search by tags. 
           Accepts one tag name or a pipe-separated list of 
           tag names.

Examples

@client.projects
@client.projects(q: "Freelance", state: "CA", field: "Branding")

Returns an array of projects in JSON format.



33
34
35
# File 'lib/behance/project.rb', line 33

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