Module: Forward::API

Defined in:
lib/forward/api.rb,
lib/forward/api/user.rb,
lib/forward/api/tunnel.rb,
lib/forward/api/resource.rb

Defined Under Namespace

Classes: Resource, Tunnel, User

Constant Summary collapse

VERSION =
'v3'.freeze
DEFAULT_API_HOST =
'https://forwardhq.com'.freeze

Class Method Summary collapse

Class Method Details

.base_pathObject



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

def self.base_path
  @base_path ||= "/api/#{VERSION}"
end

.hostObject

Returns either an api host set in the environment or a set default.

Returns a String containing the api host.



13
14
15
# File 'lib/forward/api.rb', line 13

def self.host
  @host ||= ENV['FORWARD_API_HOST'] || DEFAULT_API_HOST
end

.tokenObject



25
26
27
# File 'lib/forward/api.rb', line 25

def self.token
  defined?(@api_token) ? @api_token : nil
end

.token=(token) ⇒ Object



21
22
23
# File 'lib/forward/api.rb', line 21

def self.token=(token)
  @api_token = token
end