Class: InfluxDB::Rails::Rack

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Rack

Returns a new instance of Rack.



4
5
6
# File 'lib/influxdb/rails/rack.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#_call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/influxdb/rails/rack.rb', line 12

def _call(env)
  begin
    status, headers, body = @app.call(env)
  rescue => e
    InfluxDB.transmit_unless_ignorable(e, env)
    raise(e)
  ensure
    _body = []
    body.each { |line| _body << line } unless body.nil?
    body.close if body.respond_to?(:close)
  end

  [status, headers, _body]
end

#call(env) ⇒ Object



8
9
10
# File 'lib/influxdb/rails/rack.rb', line 8

def call(env)
  dup._call(env)
end