summaryrefslogtreecommitdiff
path: root/lib/metropolis/input_wrapper.rb
blob: 334caf6d0ac677da2462ca7f1e125e910b42fb54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- encoding: binary -*-

class Metropolis::InputWrapper
  include Metropolis::Constants

  def initialize(env)
    @input = env[Rack_Input]
    env[Rack_Input] = self
  end

  def read(*args)
    args.empty? and return read_all
    ni
  end

  def ni(*args)
    raise NotImplementedError
  end

  alias gets ni
  alias each ni
  alias rewind ni
end