Class: CPEE::Frames::GetLangs

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



331
332
333
334
335
336
337
338
339
340
# File 'lib/cpee-frames/implementation.rb', line 331

def response
  data_dir = @a[0]
  fname = File.join(data_dir,@r[-2],'info.json')
  if File.exist? fname
    infojson = JSON::parse(File.read(fname))
    Riddl::Parameter::Complex.new('value','application/json',JSON::generate(infojson["langs"]))
  else
    @status = 404
  end
end