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



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

def response
  cpee = @a[0]
  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
    handle_data cpee, instance, @p[3]&.value
    handle_waiting cpee, instance, @p[1].value
    handle_starting cpee, instance, @p[1].value
    return Riddl::Parameter::Simple.new("url",cpee + instance)
  end
end