Class: EsiForRack::Lookup::Http

Inherits:
Object
  • Object
show all
Defined in:
lib/esi_for_rack/lookup.rb

Defined Under Namespace

Classes: RedirectFollower

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Http

Returns a new instance of Http.



57
58
59
60
# File 'lib/esi_for_rack/lookup.rb', line 57

def initialize(app, env)
  @app = app
  @env = env
end

Instance Method Details

#[](path) ⇒ Object



62
63
64
65
# File 'lib/esi_for_rack/lookup.rb', line 62

def [](path)
  res = RedirectFollower.new(path).resolve
  res.body if res.code == '200'
end