Module: RelateIQ

Defined in:
lib/relateiq.rb,
lib/relateiq/list.rb,
lib/relateiq/riq_list.rb,
lib/relateiq/riq_object.rb,
lib/relateiq/api_resource.rb

Defined Under Namespace

Classes: APIResource, List, RiqList, RiqObject

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



16
17
18
# File 'lib/relateiq.rb', line 16

def api_key
  @api_key
end

.api_secretObject

Returns the value of attribute api_secret.



16
17
18
# File 'lib/relateiq.rb', line 16

def api_secret
  @api_secret
end

.base_urlObject

Returns the value of attribute base_url.



16
17
18
# File 'lib/relateiq.rb', line 16

def base_url
  @base_url
end

.versionObject

Returns the value of attribute version.



16
17
18
# File 'lib/relateiq.rb', line 16

def version
  @version
end

Class Method Details

.configure(params) ⇒ Object

Raises:

  • (ArgumentError)


18
19
20
21
22
23
24
25
26
27
28
# File 'lib/relateiq.rb', line 18

def configure(params)
  raise ArgumentError, "You must include both the api_key and api_secret" unless (params.include?(:api_key) && params.include?(:api_secret))
  @api_key = params[:api_key]
  @api_secret = params[:api_secret]
  @base_url = params[:base_url]

  @version = 'v1'
  @version = params[:version] if params[:version]

  true
end

.delete(string) ⇒ Object



43
44
45
# File 'lib/relateiq.rb', line 43

def delete(string)
  request :delete, uri(string)
end

.get(string, params = {}) ⇒ Object



30
31
32
33
# File 'lib/relateiq.rb', line 30

def get(string, params = {})
  string += "#{URI.parse(string).query ? '&' : '?'}#{uri_encode(params)}" if params && params.any?
  request :get, uri(string)
end

.post(string, params = {}) ⇒ Object



35
36
37
# File 'lib/relateiq.rb', line 35

def post(string, params={})
  request :post, uri(string), params
end

.put(string, params = {}) ⇒ Object



39
40
41
# File 'lib/relateiq.rb', line 39

def put(string, params={})
  request :put, uri(string), params
end