Class: CPEE::Logging::DownloadYAML

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/cpee-logging-xes-yaml/implementation.rb', line 81

def response
  opts = @a[0]
  fname = File.join(opts[:log_dir],@r[-1])
  if File.exist?(fname)
    io = File.open fname
    header = File.read(fname.sub(/yaml$/,'header')) if File.exist?(fname.sub(/yaml$/,'header'))
    Riddl::Parameter::Complex::new('log','text/yaml',HeaderAndFile.new(header || '',File.open(fname)))
  else
    @status = 404
  end
end