Class: WhoisXMLAPI2::Configuration
- Inherits:
-
Object
- Object
- WhoisXMLAPI2::Configuration
- Defined in:
- lib/whoisxmlapi2/configuration.rb
Constant Summary collapse
- DEFAULT_SERVICE_ENDPOINT =
"https://whoisxmlapi.com/whoisserver/WhoisService?".freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#browser_key ⇒ Object
Returns the value of attribute browser_key.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#url ⇒ Object
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/whoisxmlapi2/configuration.rb', line 7 def initialize @url = DEFAULT_SERVICE_ENDPOINT end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/whoisxmlapi2/configuration.rb', line 3 def api_key @api_key end |
#browser_key ⇒ Object
Returns the value of attribute browser_key.
3 4 5 |
# File 'lib/whoisxmlapi2/configuration.rb', line 3 def browser_key @browser_key end |
#secret ⇒ Object
Returns the value of attribute secret.
3 4 5 |
# File 'lib/whoisxmlapi2/configuration.rb', line 3 def secret @secret end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/whoisxmlapi2/configuration.rb', line 3 def url @url end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/whoisxmlapi2/configuration.rb', line 3 def username @username end |
Class Method Details
.set? ⇒ Boolean
11 12 13 14 |
# File 'lib/whoisxmlapi2/configuration.rb', line 11 def self.set? WhoisXMLAPI2.configuration.url && \ WhoisXMLAPI2.configuration.api_key end |
.set_v1? ⇒ Boolean
16 17 18 19 20 21 |
# File 'lib/whoisxmlapi2/configuration.rb', line 16 def self.set_v1? WhoisXMLAPI2.configuration.url && \ WhoisXMLAPI2.configuration.username && \ WhoisXMLAPI2.configuration.api_key && \ WhoisXMLAPI2.configuration.secret end |