Class: NameChecker::RoboWhoisChecker
- Inherits:
-
Object
- Object
- NameChecker::RoboWhoisChecker
- Includes:
- HTTParty, Logging
- Defined in:
- lib/name_checker/robo_whois_checker.rb
Defined Under Namespace
Classes: NoAPIKeyError
Class Method Summary collapse
-
.auth_options ⇒ Object
NOTE: We can’t use the ‘basic_auth’ method because the configuration object is not available at the class level.
- .check(host, options = {}) ⇒ Object
- .warning_limit ⇒ Object
Methods included from Logging
Class Method Details
.auth_options ⇒ Object
NOTE: We can’t use the ‘basic_auth’ method because the configuration object is not available at the class level.
24 25 26 27 28 29 |
# File 'lib/name_checker/robo_whois_checker.rb', line 24 def self. # raise NoAPIKeyError unless NameChecker.configuration.robo_whois_api_key { password: 'X', username: NameChecker.configuration.robo_whois_api_key } end |
.check(host, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/name_checker/robo_whois_checker.rb', line 12 def self.check(host, ={}) .merge!(basic_auth: ) res = get("/availability/#{host}", ) status = handle_response(res, host) Availability.new(@service_name, status) rescue Availability.new(@service_name, 'unknown') end |
.warning_limit ⇒ Object
31 32 33 |
# File 'lib/name_checker/robo_whois_checker.rb', line 31 def self.warning_limit 50 end |