Class: Motion::OAuth2
- Inherits:
-
Object
- Object
- Motion::OAuth2
- Defined in:
- lib/motion/oauth2.rb,
lib/motion/oauth2/error.rb,
lib/motion/oauth2/debugger.rb,
lib/motion/oauth2/response.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#schema ⇒ Object
Returns the value of attribute schema.
Class Method Summary collapse
Instance Method Summary collapse
- #delete(url, options = {}, &block) ⇒ Object
- #get(url, options = {}, &block) ⇒ Object
- #head(url, options = {}, &block) ⇒ Object
-
#initialize(access_token, schema = :Bearer) ⇒ OAuth2
constructor
A new instance of OAuth2.
- #patch(url, options = {}, &block) ⇒ Object
- #post(url, options = {}, &block) ⇒ Object
- #put(url, options = {}, &block) ⇒ Object
Constructor Details
#initialize(access_token, schema = :Bearer) ⇒ OAuth2
Returns a new instance of OAuth2.
5 6 7 8 |
# File 'lib/motion/oauth2.rb', line 5 def initialize(access_token, schema = :Bearer) self.access_token = access_token self.schema = schema end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/motion/oauth2.rb', line 3 def access_token @access_token end |
#schema ⇒ Object
Returns the value of attribute schema.
3 4 5 |
# File 'lib/motion/oauth2.rb', line 3 def schema @schema end |
Class Method Details
.debug! ⇒ Object
8 9 10 |
# File 'lib/motion/oauth2/debugger.rb', line 8 def debug! BubbleWrap.debug = true end |
.debug=(bool) ⇒ Object
4 5 6 |
# File 'lib/motion/oauth2/debugger.rb', line 4 def debug=(bool) BubbleWrap.debug = bool end |
.debug? ⇒ Boolean
12 13 14 |
# File 'lib/motion/oauth2/debugger.rb', line 12 def debug? BubbleWrap.debug? end |
Instance Method Details
#delete(url, options = {}, &block) ⇒ Object
22 23 24 |
# File 'lib/motion/oauth2.rb', line 22 def delete(url, = {}, &block) request :delete, url, , &block end |
#get(url, options = {}, &block) ⇒ Object
10 11 12 |
# File 'lib/motion/oauth2.rb', line 10 def get(url, = {}, &block) request :get, url, , &block end |
#head(url, options = {}, &block) ⇒ Object
26 27 28 |
# File 'lib/motion/oauth2.rb', line 26 def head(url, = {}, &block) request :head, url, , &block end |
#patch(url, options = {}, &block) ⇒ Object
30 31 32 |
# File 'lib/motion/oauth2.rb', line 30 def patch(url, = {}, &block) request :patch, url, , &block end |
#post(url, options = {}, &block) ⇒ Object
14 15 16 |
# File 'lib/motion/oauth2.rb', line 14 def post(url, = {}, &block) request :post, url, , &block end |
#put(url, options = {}, &block) ⇒ Object
18 19 20 |
# File 'lib/motion/oauth2.rb', line 18 def put(url, = {}, &block) request :put, url, , &block end |