Class: Oauth::Models::Consumers::SimpleClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oauth/models/consumers/simple_client.rb

Overview

This is just a simple

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ SimpleClient

Returns a new instance of SimpleClient



9
10
11
# File 'lib/oauth/models/consumers/simple_client.rb', line 9

def initialize(token)
  @token = token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token



7
8
9
# File 'lib/oauth/models/consumers/simple_client.rb', line 7

def token
  @token
end

Instance Method Details

#delete(path) ⇒ Object



18
19
20
# File 'lib/oauth/models/consumers/simple_client.rb', line 18

def delete(path)
  parse(token.delete(path, {'Accept' => 'application/json'}))
end

#get(path) ⇒ Object



26
27
28
# File 'lib/oauth/models/consumers/simple_client.rb', line 26

def get(path)
  parse(token.get(path, {'Accept' => 'application/json'}))
end

#post(path, params = {}) ⇒ Object



22
23
24
# File 'lib/oauth/models/consumers/simple_client.rb', line 22

def post(path,params={})
  parse(token.post(path,params, {'Accept' => 'application/json'}))
end

#put(path, params = {}) ⇒ Object



14
15
16
# File 'lib/oauth/models/consumers/simple_client.rb', line 14

def put(path,params={})
  parse(token.put(path,params, {'Accept' => 'application/json'}))
end