Class: CPEE::Frames::GetFrames
- Inherits:
-
Riddl::Implementation
- Object
- Riddl::Implementation
- CPEE::Frames::GetFrames
- Defined in:
- lib/cpee-frames/implementation.rb
Overview
{{{
Instance Method Summary collapse
Instance Method Details
#response ⇒ Object
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/cpee-frames/implementation.rb', line 236 def response data_dir = @a[0] fname = File.join(data_dir,@r[-2],'frames.json') if File.exist? fname infofile = File.join(data_dir,@r[-2],'info.json') infojson = JSON::parse(File.read(infofile)) # remove not used languages file = JSON::parse(File.read(fname)) file["data"].each do |child| child["url"] = child["url"].find{ |h| h['lang'] == infojson["lang"]}['url'] end Riddl::Parameter::Complex.new('value','application/json',JSON.dump(file)) else @status = 404 end end |