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
- .base_path ⇒ Object
-
.host ⇒ Object
Returns either an api host set in the environment or a set default.
- .token ⇒ Object
- .token=(token) ⇒ Object
Class Method Details
.base_path ⇒ Object
17 18 19 |
# File 'lib/forward/api.rb', line 17 def self.base_path @base_path ||= "/api/#{VERSION}" end |
.host ⇒ Object
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 |
.token ⇒ Object
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 |