Class: Mailroute::Client
Instance Method Summary collapse
- #check_connection ⇒ Object
-
#initialize(username, apikey) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(username, apikey) ⇒ Client
Returns a new instance of Client.
3 4 5 6 |
# File 'lib/mailroute/check_connection.rb', line 3 def initialize(username, apikey) @username = username @apikey = apikey end |
Instance Method Details
#check_connection ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/mailroute/check_connection.rb', line 8 def check_connection response = RestClient.get 'https://admin-dev.mailroute.net/api/v1/reseller/', 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'Authorization' => "ApiKey #@username:#@apikey" response.code == 200 end |