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-1.0.0 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.76 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.75 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.74 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.73 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.72 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.71 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.69 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.68 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.67 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.66 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.65 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.64 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.63 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.62 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.61 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.60 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.59 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.58 lib/rgviz_rails/js_renderer.rb
rgviz-rails-0.57 lib/rgviz_rails/js_renderer.rb