Class: CPEE::Frames::SetDataElements

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/cpee-frames/implementation.rb', line 273

def response
  data_dir = @a[0]
  savejson = @p.map { |o| Hash[o.name, o.value] }.to_json
  path = File.join(data_dir,@r[0],'dataelements.json')
  File.write(path, savejson)

  #puts xyz

  #puts JSON.pretty_generate(@p.to_json)



  #puts @p.length()
  #puts @p[0].name
  #puts @p[0].value

  #fname = File.join(data_dir,@r[-2],'dataelements.json')
  #if File.exists? fname
  #  Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
  #else
  #  @status = 404
  #end
end