Class: Namira::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/namira/env.rb

Overview

The calling environment for the request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Env



15
16
17
18
19
20
21
22
23
24
# File 'lib/namira/env.rb', line 15

def initialize(env)
  @uri     = Addressable::URI.parse(env[:uri].to_s)
  @body    = env[:body]
  @method  = env[:method]
  @headers = Hash(env[:headers])
  @config  = Hash(env[:config])
  @redirect_count = 0
  @response = nil
  @timing = nil
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/namira/env.rb', line 5

def body
  @body
end

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/namira/env.rb', line 5

def config
  @config
end

#headersObject

Returns the value of attribute headers.



5
6
7
# File 'lib/namira/env.rb', line 5

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



5
6
7
# File 'lib/namira/env.rb', line 5

def method
  @method
end

#redirect_countObject

Returns the value of attribute redirect_count.



5
6
7
# File 'lib/namira/env.rb', line 5

def redirect_count
  @redirect_count
end

#responseObject

Returns the value of attribute response.



5
6
7
# File 'lib/namira/env.rb', line 5

def response
  @response
end

#timingObject

Returns the value of attribute timing.



5
6
7
# File 'lib/namira/env.rb', line 5

def timing
  @timing
end

#uriObject

Returns the value of attribute uri.



5
6
7
# File 'lib/namira/env.rb', line 5

def uri
  @uri
end