Sha256: 579826ecc141a5fdd23c942e9230b75e60ecf00be4c2e7163bed833bb9ba572a

Contents?: true

Size: 682 Bytes

Versions: 48

Compression:

Stored size: 682 Bytes

Contents

module Rgviz
  module JsRenderer
    def self.render(table, tqx)
      response_handler = tqx['responseHandler']
      req_id = tqx['reqId']
      version = tqx['version']
      "#{response_handler}({reqId:'#{req_id}',status:'ok',version:'#{version}',table:#{table.to_json}});"
    end
    
    def self.render_error(reason, message, tqx)
      reason = reason.gsub("'", "\\'")
      message = message.gsub("'", "\\'")
      response_handler = tqx['responseHandler']
      req_id = tqx['reqId']
      version = tqx['version']
      "#{response_handler}({reqId:'#{req_id}',status:'error',version:'#{version}',errors:[{reason:'#{reason}', message:'#{message}'}]});"
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
rgviz-rails-0.56 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.55 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.54 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.53 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.52 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.51 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.50 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.49 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.48 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.47 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.46 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.45 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.44 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.43 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.42 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.41 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.40 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.39 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.38 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.37 lib/rgviz_rails/js_renderer.rb