Class: Leif::Connection::Exchange

Inherits:
Object
  • Object
show all
Defined in:
lib/leif/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#exchangeObject (readonly)

Returns the value of attribute exchange.



38
39
40
# File 'lib/leif/connection.rb', line 38

def exchange
  @exchange
end

Instance Method Details

#methodObject



44
45
46
# File 'lib/leif/connection.rb', line 44

def method
  exchange.env[:method].upcase
end

#request_bodyObject



56
57
58
# File 'lib/leif/connection.rb', line 56

def request_body
  exchange.env[:body]
end

#request_headersObject



52
53
54
# File 'lib/leif/connection.rb', line 52

def request_headers
  exchange.env[:request_headers]
end

#response_bodyObject



64
65
66
# File 'lib/leif/connection.rb', line 64

def response_body
  exchange.body
end

#response_headersObject



60
61
62
# File 'lib/leif/connection.rb', line 60

def response_headers
  exchange.headers
end

#uriObject



48
49
50
# File 'lib/leif/connection.rb', line 48

def uri
  exchange.env[:url].request_uri
end