Class: Namira::Env
- Inherits:
-
Object
- Object
- Namira::Env
- Defined in:
- lib/namira/env.rb
Overview
The calling environment for the request
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#config ⇒ Object
Returns the value of attribute config.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#redirect_count ⇒ Object
Returns the value of attribute redirect_count.
-
#response ⇒ Object
Returns the value of attribute response.
-
#timing ⇒ Object
Returns the value of attribute timing.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(env) ⇒ Env
constructor
A new instance of Env.
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
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def body @body end |
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def config @config end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def method @method end |
#redirect_count ⇒ Object
Returns the value of attribute redirect_count.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def redirect_count @redirect_count end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def response @response end |
#timing ⇒ Object
Returns the value of attribute timing.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def timing @timing end |
#uri ⇒ Object
Returns the value of attribute uri.
5 6 7 |
# File 'lib/namira/env.rb', line 5 def uri @uri end |