Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/ruby-box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'ruby-box/folder'
require 'ruby-box/user'
require 'ruby-box/comment'
require 'ruby-box/task'
require 'ruby-box/collaboration'
require 'ruby-box/discussion'
require 'ruby-box/exceptions'
Expand Down
5 changes: 5 additions & 0 deletions lib/ruby-box/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def file_by_id(id)
file.reload_meta
end

def task_by_id(id)
task = Task.new(@session, {'id' => id})
task.reload_meta
end

def file(path)
path = split_path( path.sub(/^\.\//, '') )
file_name = path.pop
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby-box/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def has_mini_format?
true
end
end
end
end
1 change: 1 addition & 0 deletions lib/ruby-box/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module RubyBox
class File < Item

has_many :comments
has_many :tasks

def download
resp = stream.read
Expand Down
21 changes: 21 additions & 0 deletions lib/ruby-box/task.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module RubyBox
class Task < Item
has_many :task_assignments

def initialize(session, entry)
super(session, entry)
reload_meta
self
end

private

def resource_name
'tasks'
end

def has_mini_format?
true
end
end
end