Class: Leif::Connection::Exchange
- Inherits:
-
Object
- Object
- Leif::Connection::Exchange
- Defined in:
- lib/leif/connection.rb
Instance Attribute Summary collapse
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
Instance Method Summary collapse
-
#initialize(exchange) ⇒ Exchange
constructor
A new instance of Exchange.
- #method ⇒ Object
- #request_body ⇒ Object
- #request_headers ⇒ Object
- #response_body ⇒ Object
- #response_headers ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(exchange) ⇒ Exchange
Returns a new instance of Exchange.
40 41 42 |
# File 'lib/leif/connection.rb', line 40 def initialize(exchange) @exchange = exchange end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
38 39 40 |
# File 'lib/leif/connection.rb', line 38 def exchange @exchange end |
Instance Method Details
#method ⇒ Object
44 45 46 |
# File 'lib/leif/connection.rb', line 44 def method exchange.env[:method].upcase end |
#request_body ⇒ Object
56 57 58 |
# File 'lib/leif/connection.rb', line 56 def request_body exchange.env[:body] end |
#request_headers ⇒ Object
52 53 54 |
# File 'lib/leif/connection.rb', line 52 def request_headers exchange.env[:request_headers] end |
#response_body ⇒ Object
64 65 66 |
# File 'lib/leif/connection.rb', line 64 def response_body exchange.body end |
#response_headers ⇒ Object
60 61 62 |
# File 'lib/leif/connection.rb', line 60 def response_headers exchange.headers end |
#uri ⇒ Object
48 49 50 |
# File 'lib/leif/connection.rb', line 48 def uri exchange.env[:url].request_uri end |