Class: CPEE::DeleteInstance

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee/implementation.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



165
166
167
168
169
170
171
172
173
174
175
# File 'lib/cpee/implementation.rb', line 165

def response
  controller = @a[0]
  opts = @a[1]
  id = @r[0].to_i
  unless controller[id]
    @status = 400
    return
  end
  controller.delete(id)
  FileUtils.rm_r(opts[:instances] + "/#{@r[0]}")
end