Class: Motion::OAuth2

Inherits:
Object
  • Object
show all
Defined in:
lib/motion/oauth2.rb,
lib/motion/oauth2/error.rb,
lib/motion/oauth2/debugger.rb,
lib/motion/oauth2/response.rb

Defined Under Namespace

Classes: Error, Response

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_tokenObject

Returns the value of attribute access_token.



3
4
5
# File 'lib/motion/oauth2.rb', line 3

def access_token
  @access_token
end

#schemaObject

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

Returns:

  • (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, options = {}, &block)
  request :delete, url, options, &block
end

#get(url, options = {}, &block) ⇒ Object



10
11
12
# File 'lib/motion/oauth2.rb', line 10

def get(url, options = {}, &block)
  request :get, url, options, &block
end

#head(url, options = {}, &block) ⇒ Object



26
27
28
# File 'lib/motion/oauth2.rb', line 26

def head(url, options = {}, &block)
  request :head, url, options, &block
end

#patch(url, options = {}, &block) ⇒ Object



30
31
32
# File 'lib/motion/oauth2.rb', line 30

def patch(url, options = {}, &block)
  request :patch, url, options, &block
end

#post(url, options = {}, &block) ⇒ Object



14
15
16
# File 'lib/motion/oauth2.rb', line 14

def post(url, options = {}, &block)
  request :post, url, options, &block
end

#put(url, options = {}, &block) ⇒ Object



18
19
20
# File 'lib/motion/oauth2.rb', line 18

def put(url, options = {}, &block)
  request :put, url, options, &block
end