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



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

def response
  cpee     = @a[0]
  behavior = @a[1] ? 'fork_ready' : @p[0].value
  data     = @a[1] ? 0 : 1
  selfurl  = @a[2]
  cblist   = @a[3]
  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
    @headers << Riddl::Header.new('CPEE-INSTANTIATION',File.join(cpee,instance))
    handle_data cpee, instance, @p[data+1]&.value
    handle_waiting cpee, instance, behavior, selfurl, cblist
    handle_starting cpee, instance, behavior
    return Riddl::Parameter::Simple.new("url",cpee + instance)
  end
end