Class: ZeusSdk::V1::Core
- Inherits:
-
Object
- Object
- ZeusSdk::V1::Core
- Includes:
- HTTParty
- Defined in:
- lib/zeus_sdk/v1/core.rb
Class Method Summary collapse
Instance Method Summary collapse
- #check_domain(domain) ⇒ Object
-
#initialize(auth_token) ⇒ Core
constructor
A new instance of Core.
Constructor Details
#initialize(auth_token) ⇒ Core
Returns a new instance of Core.
22 23 24 |
# File 'lib/zeus_sdk/v1/core.rb', line 22 def initialize(auth_token) self.class.headers "Authorization" => "Bearer #{auth_token}" end |
Class Method Details
.get_base_uri ⇒ Object
11 12 13 14 15 16 |
# File 'lib/zeus_sdk/v1/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_env ⇒ Object
7 8 9 |
# File 'lib/zeus_sdk/v1/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_sdk/v1/core.rb', line 26 def check_domain(domain) self.class.get("/domains/exists", query: {domain: domain}) end |