Created
October 25, 2012 13:42
-
-
Save noeticpenguin/3952612 to your computer and use it in GitHub Desktop.
Dobedobedo gem Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dobedobedo' # please do this with the bundler. | |
include Dobedobedo # gives you access to the top level models. | |
#Dobedobedo does not use the web-flow for oAuth integration, instead relying on username and password, in conjunction with the oAuth client id / secret | |
connection = Dobedobedo::Connection.new(:client_id => 'Your Client Id', | |
:client_secret => 'Your Client Secret', | |
:username => 'Your Email Address', | |
:password => 'Your Passsord Here') | |
#by_name is an alias to find_workspace_by_name | |
workspace = connection.by_name('workspace name here') | |
#array of Dobedobedo::Project objects reflecting each of the projects | |
projects = workspace.projects | |
#array of task objects from the first project in the workspace | |
projects.first.tasks # you could also use projects[2].tasks to get the tasks from the third project of the workspace selected above. | |
#This will grab the first task of the first project of the workspace selected. | |
task = projects.first.tasks.first | |
task.name = 'new name' #give the task a new name | |
task.description = 'this is a new description of awesomeness' | |
task.closed = True #mark the task as done | |
task.update | |
#updated task! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment