Class: CPEE::NewInstance

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/cpee/implementation.rb', line 152

def response
  controller = @a[0]
  opts = @a[1]
  name = @p[0].value
  id = controller.keys.sort.last.to_i

  while true
    id += 1
    Dir.mkdir(opts[:instances] + "/#{id}") rescue nil
    break
  end
  controller[id] = Controller.new(id,opts)
  info = controller[id].properties.data.find("/p:properties/p:attributes/p:info")
  info.first.text = name if info.length == 1

  Riddl::Parameter::Simple.new("id", id)
end