Method: ActiveCMIS::Collection#destroy
- Defined in:
- lib/active_cmis/collection.rb
#destroy(options = {}) ⇒ Object
Attempts to delete the collection. This may not work on every collection, ActiveCMIS does not (yet) try to check this client side.
For folder collections 2 options are available, again no client side checking is done to see whether the collection can handle these options
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/active_cmis/collection.rb', line 153 def destroy( = {}) if .empty? conn.delete(@url) else unfileObjects = .delete(:unfileObjects) continueOnFailure = .delete(:continueOnFailure) raise ArgumentError("Unknown parameters #{.keys.join(', ')}") unless .empty? # XXX: have less cumbersome code, more generic and more efficient code new_url = @url new_url = Internal::Utils.append_parameters(new_url, :unfileObjects => unfileObjects) unless unfileObjects.nil? new_url = Internal::Utils.append_parameters(new_url, :continueOnFailure => continueOnFailure) unless continueOnFailure.nil? # TODO: check that we can handle 200,202,204 responses correctly conn.delete(@url) end end |