Class: OAuthActiveResource::FakeOAuthAccessToken
- Inherits:
-
OAuth::Consumer
- Object
- OAuth::Consumer
- OAuthActiveResource::FakeOAuthAccessToken
- Defined in:
- lib/oauth_active_resource/fake_oauth_access_token.rb
Overview
just simulates the request and sign! methods of a oauth access token
Instance Attribute Summary collapse
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #delete(path, headers = {}) ⇒ Object
- #get(path, headers = {}) ⇒ Object
- #head(path, headers = {}) ⇒ Object
-
#initialize ⇒ FakeOAuthAccessToken
constructor
A new instance of FakeOAuthAccessToken.
- #post(path, body = '', headers = {}) ⇒ Object
- #put(path, body = '', headers = {}) ⇒ Object
- #request(http_method, path, token = nil, request_options = {}, *arguments) ⇒ Object
- #sign!(*args) ⇒ Object
Constructor Details
#initialize ⇒ FakeOAuthAccessToken
Returns a new instance of FakeOAuthAccessToken.
7 8 9 10 11 12 13 14 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 7 def initialize() @key = nil token = 'Anonymous' secret = 'Anonymous' # ensure that keys are symbols @options = @@default_options end |
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret.
6 7 8 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 6 def secret @secret end |
#token ⇒ Object
Returns the value of attribute token.
6 7 8 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 6 def token @token end |
Instance Method Details
#delete(path, headers = {}) ⇒ Object
45 46 47 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 45 def delete(path, headers = {}) request(:delete, path, headers) end |
#get(path, headers = {}) ⇒ Object
29 30 31 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 29 def get(path, headers = {}) request(:get, path, headers) end |
#head(path, headers = {}) ⇒ Object
33 34 35 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 33 def head(path, headers = {}) request(:head, path, headers) end |
#post(path, body = '', headers = {}) ⇒ Object
37 38 39 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 37 def post(path, body = '', headers = {}) request(:post, path, body, headers) end |
#put(path, body = '', headers = {}) ⇒ Object
41 42 43 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 41 def put(path, body = '', headers = {}) request(:put, path, body, headers) end |
#request(http_method, path, token = nil, request_options = {}, *arguments) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 16 def request(http_method, path, token = nil, = {}, *arguments) if path !~ /^\// @http = create_http(path) _uri = URI.parse(path) path = "#{_uri.path}#{_uri.query ? "?#{_uri.query}" : ""}" end rsp = http.request(create_http_request(http_method, path, token, , *arguments)) rsp end |
#sign!(*args) ⇒ Object
49 50 51 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 49 def sign!(*args) # do nothing end |