Class: Cloopen::REST::Client

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/cloopen/rest/client.rb

Constant Summary collapse

API_VERSION =
'2013-03-22'
HTTP_HEADERS =
{
  'Accept' => 'application/xml',
  'Content-Type' => 'application/xml;charset=utf-8'
}
PRODUCTION_HOST =
'https://app.cloopen.com'
LOCAL_HOST =
'http://localhost'
SANDBOX_HOST =
'https://sandboxapp.cloopen.com'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#beautify_hash, #build_body, #cloopfy, #decloopfy, #downcase_first, #prase_body

Constructor Details

#initialize(account_sid, auth_token, app_id, options = {}) ⇒ Client

Returns a new instance of Client.



19
20
21
22
23
24
# File 'lib/cloopen/rest/client.rb', line 19

def initialize(, auth_token, app_id, options={})
  @account_sid, @auth_token, @app_id = .strip, auth_token.strip, app_id.strip
  @config = apply_defaults(options)
  generate_authorization_params
  set_up_subresources
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def 
  @account
end

#account_sidObject (readonly)

Returns the value of attribute account_sid.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def 
  @account_sid
end

#app_idObject (readonly)

Returns the value of attribute app_id.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def app_id
  @app_id
end

#auth_tokenObject (readonly)

Returns the value of attribute auth_token.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def auth_token
  @auth_token
end

#authorizationObject (readonly)

Returns the value of attribute authorization.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def authorization
  @authorization
end

#configObject (readonly)

Returns the value of attribute config.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def config
  @config
end

#headersObject (readonly)

Returns the value of attribute headers.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def headers
  @headers
end

#signatureObject (readonly)

Returns the value of attribute signature.



17
18
19
# File 'lib/cloopen/rest/client.rb', line 17

def signature
  @signature
end

Instance Method Details

#inspecObject



26
27
28
# File 'lib/cloopen/rest/client.rb', line 26

def inspec
  "<Cloopen::REST::Client @account_sid=#{@account_sid}>"
end