Class: OpenStreetMap::OauthClient

Inherits:
Object
  • Object
show all
Defined in:
lib/open_street_map/oauth_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_tokenObject (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

Raises:



19
20
21
22
23
# File 'lib/open_street_map/oauth_client.rb', line 19

def delete(url, options={}, 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, options={}, header={})
  body = options[: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, options={}, header={})
  body = options[:body]
  access_token.put(url, body, {'Content-Type' => 'application/xml' })
end