Class: OAuthClient::Adapters::Xml
- Inherits:
-
Object
- Object
- OAuthClient::Adapters::Xml
- Defined in:
- lib/oauth_client/adapters/xml.rb
Overview
Xml Adapter for OAuthClient
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#get(url) ⇒ Object
make a GET request and parse Xml response.
-
#initialize(client) ⇒ Xml
constructor
on creation, the adapter must be supplied with the client.
-
#post(url, params = {}) ⇒ Object
make a GET request and parse Xml response.
Constructor Details
#initialize(client) ⇒ Xml
on creation, the adapter must be supplied with the client
9 10 11 |
# File 'lib/oauth_client/adapters/xml.rb', line 9 def initialize(client) self.client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/oauth_client/adapters/xml.rb', line 6 def client @client end |
Instance Method Details
#get(url) ⇒ Object
make a GET request and parse Xml response
14 15 16 17 |
# File 'lib/oauth_client/adapters/xml.rb', line 14 def get(url) oauth_response = self.client.get(url) Nokogiri::XML::Document.parse(oauth_response.body) end |
#post(url, params = {}) ⇒ Object
make a GET request and parse Xml response
20 21 22 23 |
# File 'lib/oauth_client/adapters/xml.rb', line 20 def post(url, params = {}) oauth_response = self.client.post(url, params) Nokogiri::XML::Document.parse(oauth_response.body) end |