Class: CPEE::Frames::SetLang
- Inherits:
-
Riddl::Implementation
- Object
- Riddl::Implementation
- CPEE::Frames::SetLang
- Defined in:
- lib/cpee-frames/implementation.rb
Overview
}}}
Instance Method Summary collapse
-
#response ⇒ Object
{{{.
Instance Method Details
#response ⇒ Object
{{{
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/cpee-frames/implementation.rb', line 325 def response fname = File.join('data',@r[-2],'info.json') if File.exists? fname infojson = JSON::parse(File.read(fname)) infojson["lang"] = @p[0].value #add to langs if !infojson["langs"].include?(@p[0].value) infojson["langs"].push(@p[0].value) end File.write(fname, JSON.dump(infojson)) @a[0].send('reset') nil else @status = 404 end end |