Class: ZeusClient::V1::Core

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/zeus/v1/client/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth_token) ⇒ Core

Returns a new instance of Core.



22
23
24
# File 'lib/zeus/v1/client/core.rb', line 22

def initialize(auth_token)
    self.class.headers "Authorization" => "Bearer #{auth_token}" 
end

Class Method Details

.get_base_uriObject



11
12
13
14
15
16
# File 'lib/zeus/v1/client/core.rb', line 11

def self.get_base_uri
    base_uri = "https://api.zeusdev.io" if self.get_env == "production"
    base_uri = "http://localhost:3000" if self.get_env != "production"

    base_uri
end

.get_envObject



7
8
9
# File 'lib/zeus/v1/client/core.rb', line 7

def self.get_env
    @env ||= ENV['RACK_ENV'] || ENV['RAILS_ENV']
end

Instance Method Details

#check_domain(domain) ⇒ Object



26
27
28
# File 'lib/zeus/v1/client/core.rb', line 26

def check_domain(domain)
    self.class.get("/domains/exists", query: {domain: domain})
end