Class: OpenStreetMap::OauthClient
- Inherits:
-
Object
- Object
- OpenStreetMap::OauthClient
- Defined in:
- lib/open_street_map/oauth_client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
- #delete(url, options = {}, header = {}) ⇒ Object
- #get(url, header = {}) ⇒ Object
-
#initialize(access_token) ⇒ OauthClient
constructor
A new instance of OauthClient.
- #post(url, options = {}, header = {}) ⇒ Object
- #put(url, options = {}, header = {}) ⇒ Object
Constructor Details
#initialize(access_token) ⇒ OauthClient
Returns a new instance of OauthClient.
6 7 8 |
# File 'lib/open_street_map/oauth_client.rb', line 6 def initialize(access_token) @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/open_street_map/oauth_client.rb', line 4 def access_token @access_token end |
Instance Method Details
#delete(url, options = {}, header = {}) ⇒ Object
19 20 21 22 23 |
# File 'lib/open_street_map/oauth_client.rb', line 19 def delete(url, ={}, header={}) raise NotImplemented.new("Delete with Oauth and OSM is not supported") # body = options[:body] # access_token.delete(url, {'Content-Type' => 'application/xml' }) end |
#get(url, header = {}) ⇒ Object
10 11 12 |
# File 'lib/open_street_map/oauth_client.rb', line 10 def get(url, header={}) access_token.get(url, {'Content-Type' => 'application/xml' }) end |
#post(url, options = {}, header = {}) ⇒ Object
25 26 27 28 |
# File 'lib/open_street_map/oauth_client.rb', line 25 def post(url, ={}, header={}) body = [:body] access_token.post(url, body, {'Content-Type' => 'application/xml' }) end |
#put(url, options = {}, header = {}) ⇒ Object
14 15 16 17 |
# File 'lib/open_street_map/oauth_client.rb', line 14 def put(url, ={}, header={}) body = [:body] access_token.put(url, body, {'Content-Type' => 'application/xml' }) end |