Class: CPEE::Instantiation::InstantiateUrl

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



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/cpee/instantiation.rb', line 132

def response
  cpee = @a[0]
  selfurl = @a[1]
  cblist = @a[2]
  status, res = Riddl::Client.new(@p[2].value).get
  tdoc = if status >= 200 && status < 300
    res[0].value.read
  else
    (@status = 500) && return
  end

  if (instance = load_testset(tdoc,cpee,@p[0].value)) == -1
    @status = 500
  else
    @headers << Riddl::Header.new('CPEE-INSTANTIATION',File.join(cpee,instance))
    handle_data cpee, instance, @p[3]&.value
    handle_waiting cpee, instance, @p[1].value, selfurl, cblist
    handle_starting cpee, instance, @p[1].value
    return Riddl::Parameter::Simple.new("url",cpee + instance)
  end
end