Class: ContextIO::Lite::API

Inherits:
API::AbstractAPI show all
Defined in:
lib/contextio/lite/api.rb

Constant Summary collapse

VERSION =
'lite'

Constants inherited from API::AbstractAPI

API::AbstractAPI::BASE_URL

Instance Attribute Summary

Attributes inherited from API::AbstractAPI

#base_url, #key, #opts, #secret, #version

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from API::AbstractAPI

base_url, #initialize, #path, #raw_request, #request, #user_agent_string, version

Constructor Details

This class inherits a constructor from ContextIO::API::AbstractAPI

Class Method Details

.url_for(resource) ⇒ String

Returns The URL for the resource in the API.

Parameters:

  • resource (Object)

    The resource you want the URL for.

Returns:

  • (String)

    The URL for the resource in the API.



17
18
19
# File 'lib/contextio/lite/api.rb', line 17

def self.url_for(resource)
	ContextIO::Lite::URLBuilder.url_for(resource)
end

.user_agent_stringObject



10
11
12
# File 'lib/contextio/lite/api.rb', line 10

def self.user_agent_string
	"contextio-#{self.version}-ruby-#{ContextIO.version}"
end

Instance Method Details

#url_for(resource) ⇒ String

Returns The URL for the resource in the API.

Parameters:

  • resource (Object)

    The resource you want the URL for.

Returns:

  • (String)

    The URL for the resource in the API.



24
25
26
# File 'lib/contextio/lite/api.rb', line 24

def url_for(resource)
	ContextIO::Lite::API.url_for(resource)
end