Class: Episodic::Platform::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/episodic/platform/base.rb

Overview

Episodic::Platform::Base is the abstract super class of all classes who make requests against the Episodic Platform REST API.

Establishing a connection with the Base class is the entry point to using the library:

Episodic::Platform::Base.establish_connection!('my_api_key', 'my_secret_key')

Direct Known Subclasses

AnalyticsMethods, QueryMethods, WriteMethods

Class Method Summary collapse

Class Method Details

.construct_url(api_name, method_name) ⇒ Object

Helper method to construct an Episodic Platform API request URL.

Parameters

api_name<String>

Specifies the API you are calling. Examples are “write”, query“ and ”analytics“

method_name<String>

The method being invoked.

Returns

URI

The constructed URL.



55
56
57
# File 'lib/episodic/platform/base.rb', line 55

def construct_url api_name, method_name
  return URI.parse("http://#{connection.connection_options[:api_host] || API_HOST}/api/#{API_VERSION}/#{api_name}/#{method_name}")
end