Class: Rack::GetData

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/get_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ GetData

Returns a new instance of GetData.



3
4
5
# File 'lib/rack/get_data.rb', line 3

def initialize(app)
  @app=app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rack/get_data.rb', line 7

def call(env)
  if env['PATH_INFO'] == '/getData'
    request = Rack::Request.new(env)
    if request.params['jsonString'] != ""
      error_code = Ss2.send_js_request request, request.params
    end	
    [200, {"Content-Type" => 'text/plain'},["error_code: #{error_code}"]]
  else
    @app.call(env)
  end
end