Class: CPEE::NewInstance

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/cpee/implementation.rb', line 129

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)
  controller[id].properties.data.find("/p:properties/p:info").first.text = name

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