Class: Faraday::Request::XML
- Inherits:
-
Middleware
- Object
- Middleware
- Faraday::Request::XML
- Defined in:
- lib/faraday/request/xml.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ XML
constructor
A new instance of XML.
Constructor Details
#initialize(app, options = {}) ⇒ XML
Returns a new instance of XML.
6 7 8 9 |
# File 'lib/faraday/request/xml.rb', line 6 def initialize(app, ={}) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/faraday/request/xml.rb', line 11 def call(env) if env[:method] == :post env[:body] = env[:body].to_xml(:root => env[:body].delete(:root)) end @app.call(env) end |