Class: Flukso::TokenAuth

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/flukso/http_auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token) ⇒ TokenAuth

, base_url)



30
31
32
33
34
# File 'lib/flukso/http_auth.rb', line 30

def initialize(access_token)#, base_url)
  @access_token = access_token
  #@options = {:ssl => true}.merge(options)
  #self.class.base_uri "#{base_url}"
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



28
29
30
# File 'lib/flukso/http_auth.rb', line 28

def options
  @options
end

Instance Method Details

#delete(uri, body = {}, headers = {}) ⇒ Object



50
51
52
# File 'lib/flukso/http_auth.rb', line 50

def delete(uri, body={}, headers={})
  self.class.delete(uri, :body => body, :headers => add_auth_header(headers))
end

#get(uri, headers = {}) ⇒ Object



37
38
39
40
# File 'lib/flukso/http_auth.rb', line 37

def get(uri, headers={})
  headers=add_auth_header(headers);
  self.class.get(uri, :headers => headers)
end

#post(uri, body = {}, headers = {}) ⇒ Object



42
43
44
# File 'lib/flukso/http_auth.rb', line 42

def post(uri, body={}, headers={})
  self.class.post(uri, :body => body, :headers => add_auth_header(headers))
end

#put(uri, body = {}, headers = {}) ⇒ Object



46
47
48
# File 'lib/flukso/http_auth.rb', line 46

def put(uri, body={}, headers={})
  self.class.put(uri, :body => body, :headers => add_auth_header(headers))
end