lib/ruby-box/folder.rb in ruby-box-1.7.0 vs lib/ruby-box/folder.rb in ruby-box-1.8.0

- old
+ new

@@ -40,25 +40,14 @@ end # see http://developers.box.com/docs/#collaborations-collaboration-object # for a list of valid roles. def create_collaboration(email, role=:viewer) - collaboration = RubyBox::Collaboration.new(@session, { + RubyBox::Collaboration.new(@session, { 'item' => {'id' => id, 'type' => type}, 'accessible_by' => {'login' => email}, 'role' => role.to_s - }) - - collaboration.create - end - - def create_subfolder(name) - url = "#{RubyBox::API_URL}/#{resource_name}" - uri = URI.parse(url) - request = Net::HTTP::Post.new( uri.request_uri ) - request.body = JSON.dump({ "name" => name, "parent" => {"id" => id} }) - resp = @session.request(uri, request) - RubyBox::Folder.new(@session, resp) + }).create end private def resource_name \ No newline at end of file