Class: Gapi::EmOauthMiddle

Inherits:
Object
  • Object
show all
Defined in:
lib/gapi/em_oauth_middle.rb

Constant Summary collapse

CONNECT_TIMEOUT_S =

connection timeout in seconds

10
INACTIVITY_TIMEOUT_S =

inactivity timeout in seconds

0

Instance Method Summary collapse

Constructor Details

#initialize(consumer_key, consumer_secret, access_token, access_secret) ⇒ EmOauthMiddle

these are all strings not the access token object from ruby-oauth



15
16
17
18
19
20
21
22
# File 'lib/gapi/em_oauth_middle.rb', line 15

def initialize( consumer_key, consumer_secret, access_token, access_secret )
  @oauth_opts = {
    :consumer_key => consumer_key,
    :consumer_secret => consumer_secret,
    :access_token => access_token,
    :access_token_secret => access_secret
  }
end

Instance Method Details

#get(domain, path, opts) ⇒ Object



24
25
26
27
28
29
# File 'lib/gapi/em_oauth_middle.rb', line 24

def get( domain, path, opts )
  data = opts.collect {|kv| kv.join('=') }.join('&')
  path = "#{path}?#{data}" if data && data.length > 0
  http = http_get( "https://#{domain}#{path}" )
  return http.response_header.status, http.response
end