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.
5 6 7 8 9 10 11 12 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 5 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.
4 5 6 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 4 def secret @secret end |
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 4 def token @token end |
Instance Method Details
#delete(path, headers = {}) ⇒ Object
40 41 42 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 40 def delete(path, headers = {}) request(:delete, path, headers) end |
#get(path, headers = {}) ⇒ Object
24 25 26 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 24 def get(path, headers = {}) request(:get, path, headers) end |
#head(path, headers = {}) ⇒ Object
28 29 30 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 28 def head(path, headers = {}) request(:head, path, headers) end |
#post(path, body = '', headers = {}) ⇒ Object
32 33 34 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 32 def post(path, body = '', headers = {}) request(:post, path, body, headers) end |
#put(path, body = '', headers = {}) ⇒ Object
36 37 38 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 36 def put(path, body = '', headers = {}) request(:put, path, body, headers) end |
#request(http_method, path, token = nil, request_options = {}, *arguments) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 14 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 http.request(create_http_request(http_method, path, token, , *arguments)) end |
#sign!(*args) ⇒ Object
44 45 46 |
# File 'lib/oauth_active_resource/fake_oauth_access_token.rb', line 44 def sign!(*args) # do nothing end |