Parent

Files

Oauth::Models::Consumers::SimpleClient

This is just a simple

Attributes

token[R]

Public Class Methods

new(token) click to toggle source
    # File lib/oauth/models/consumers/simple_client.rb, line 9
 9:         def initialize(token)
10:           @token = token
11:         end

Public Instance Methods

delete(path) click to toggle source
    # File lib/oauth/models/consumers/simple_client.rb, line 18
18:         def delete(path)
19:           parse(token.delete(path, {'Accept' => 'application/json'}))
20:         end
get(path) click to toggle source
    # File lib/oauth/models/consumers/simple_client.rb, line 26
26:         def get(path)
27:           parse(token.get(path, {'Accept' => 'application/json'}))
28:         end
post(path,params={}) click to toggle source
    # File lib/oauth/models/consumers/simple_client.rb, line 22
22:         def post(path,params={})
23:           parse(token.post(path,params, {'Accept' => 'application/json'}))
24:         end
put(path,params={}) click to toggle source
    # File lib/oauth/models/consumers/simple_client.rb, line 14
14:         def put(path,params={})
15:           parse(token.put(path,params, {'Accept' => 'application/json'}))
16:         end

Protected Instance Methods

parse(response) click to toggle source
    # File lib/oauth/models/consumers/simple_client.rb, line 32
32:         def parse(response)
33:           return false unless response
34:           if ["200","201"].include? response.code
35:             unless response.body.blank?
36:               JSON.parse(response.body)
37:             else
38:               true
39:             end
40:           else
41:             logger.debug "Got Response code: #{response.code}"
42:             false
43:           end
44:           
45:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.