Class: Dobedobedo::Workspace
- Inherits:
-
Object
- Object
- Dobedobedo::Workspace
- Defined in:
- lib/dobedobedo/workspace.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #alerts ⇒ Object
- #find_project_by_name(name) ⇒ Object
-
#initialize(token, h = {}) ⇒ Workspace
constructor
A new instance of Workspace.
- #notes ⇒ Object
- #projects ⇒ Object
- #tasks ⇒ Object
- #users ⇒ Object
Constructor Details
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/dobedobedo/workspace.rb', line 3 def token @token end |
Instance Method Details
#alerts ⇒ Object
31 32 33 |
# File 'lib/dobedobedo/workspace.rb', line 31 def alerts @token.get("/workspaces/#{@id}/alerts").parsed.map {|a| Dobedobedo::Alert.new(@token, a)} end |
#find_project_by_name(name) ⇒ Object
19 20 21 |
# File 'lib/dobedobedo/workspace.rb', line 19 def find_project_by_name(name) projects.select {|x| x.name == name}.first end |
#notes ⇒ Object
27 28 29 |
# File 'lib/dobedobedo/workspace.rb', line 27 def notes @token.get("/workspaces/#{@id}/notes").parsed.map {|n| Dobedobedo::Note.new(@token, @id, n)} end |
#projects ⇒ Object
15 16 17 |
# File 'lib/dobedobedo/workspace.rb', line 15 def projects @token.get("/workspaces/#{@id}/projects").parsed.map {|p| Dobedobedo::Project.new(@token, @id, p)} end |
#tasks ⇒ Object
23 24 25 |
# File 'lib/dobedobedo/workspace.rb', line 23 def tasks @token.get("/workspaces/#{@id}/tasks/").parsed.map {|t| Dobedobedo::Task.new(@token, @id, nil, t)} end |
#users ⇒ Object
35 36 37 |
# File 'lib/dobedobedo/workspace.rb', line 35 def users @token.get("/workspaces/#{@id}/users").parsed.map {|u| Dobedobedo::User.new(@token, @id, u)} end |