Class: CPEE::Instantiation::InstantiateXML

Inherits:
Riddl::Implementation
  • Object
show all
Includes:
Helpers
Defined in:
lib/cpee/instantiation.rb

Overview

}}}

Instance Method Summary collapse

Methods included from Helpers

#handle_data

Instance Method Details

#responseObject



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/cpee/instantiation.rb', line 159

def response
  cpee     = @a[0]
  behavior = @a[1] ? 'fork_ready' : @p[0].value
  data     = @a[1] ? 0 : 1
  tdoc = if @p[data].additional =~ /base64/
    Base64.decode64(@p[data].value.read)
  else
    @p[data].value.read
  end

  if (instance = load_testset(tdoc,cpee)) == -1
    @status = 500
  else
    handle_data cpee, instance, @p[data+1]&.value
    handle_waiting cpee, instance, behavior
    handle_starting cpee, instance, behavior
    return Riddl::Parameter::Simple.new("url",cpee + instance)
  end
end