lib/ruby-box/folder.rb in ruby-box-1.4.0 vs lib/ruby-box/folder.rb in ruby-box-1.5.0
- old
+ new
@@ -49,9 +49,18 @@
})
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)
+ end
+
private
def resource_name
'folders'
end
\ No newline at end of file