Skip to content

Commit

Permalink
Initial implementation of #create_workspace (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscharley authored and forest committed Sep 13, 2016
1 parent 3651fa3 commit 1d29ccd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/tracker_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ def project(id, params={})
Endpoints::Project.new(self).get(id, params)
end

# Create a new workspace.
#
# @param [Hash] params attributes to create the workspace with
# @return [TrackerApi::Resources::Workspace] newly created Workspace
def create_workspace(params)
Endpoints::Workspace.new(self).create(params)
end

# Get workspace
#
# @param [Hash] params
Expand Down
6 changes: 6 additions & 0 deletions lib/tracker_api/endpoints/workspace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ def get(id, params={})

Resources::Workspace.new({ client: client }.merge(data))
end

def create(params={})
data = client.post("/my/workspaces", params: params).body

Resources::Workspace.new({ client: client }.merge(data))
end
end
end
end

0 comments on commit 1d29ccd

Please sign in to comment.