Class: Immunio::InputWrapper

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/immunio/plugins/http_tracker.rb

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ InputWrapper

Returns a new instance of InputWrapper.



167
168
169
170
# File 'lib/immunio/plugins/http_tracker.rb', line 167

def initialize(input)
  super input
  @input = input
end

Instance Method Details

#eachObject



188
189
190
191
192
193
194
195
196
197
# File 'lib/immunio/plugins/http_tracker.rb', line 188

def each
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    @input.each do |chunk|
      report_chunk chunk
      Request.pause "plugin", "#{Module.nesting[0]}::#{__method__}" do
        yield chunk
      end
    end
  end
end

#getsObject



172
173
174
175
176
177
178
# File 'lib/immunio/plugins/http_tracker.rb', line 172

def gets(*)
  v = super
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    report_chunk v
  end
  v
end

#readObject



180
181
182
183
184
185
186
# File 'lib/immunio/plugins/http_tracker.rb', line 180

def read(*)
  v = super
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    report_chunk v
  end
  v
end