Class: Varanus::DCV
- Inherits:
-
RestResource
- Object
- RestResource
- Varanus::DCV
- Defined in:
- lib/varanus/dcv.rb
Overview
An connection to the DCV API. This should not be initialized directly. Instead, use Varanus#dcv
Instance Method Summary collapse
-
#search(opts = {}) ⇒ Object
Returns an Array of DCV information about searched for domains.
-
#start(domain, type) ⇒ Object
Start domain validation process.
-
#status(domain) ⇒ Object
Retrieve DCV status for a single domain Result will included an extra ‘expiration_date_obj’ if ‘expirationDate’ is in the response.
-
#submit(domain, type, email_address = nil) ⇒ Object
Submit domain validation for verficiation.
Methods inherited from RestResource
Constructor Details
This class inherits a constructor from Varanus::RestResource
Instance Method Details
#search(opts = {}) ⇒ Object
Returns an Array of DCV information about searched for domains. This method will automatically page through all results Results will included an extra ‘expiration_date_obj’ if ‘expirationDate’ is in the response
18 19 20 |
# File 'lib/varanus/dcv.rb', line 18 def search opts = {} get_with_size_and_position('dcv/v2/validation', opts).map(&method(:_format_status)) end |
#start(domain, type) ⇒ Object
Start domain validation process. This must be called before #submit is called
26 27 28 |
# File 'lib/varanus/dcv.rb', line 26 def start domain, type post("dcv/v1/validation/start/domain/#{type}", domain: domain) end |
#status(domain) ⇒ Object
Retrieve DCV status for a single domain Result will included an extra ‘expiration_date_obj’ if ‘expirationDate’ is in the response
33 34 35 |
# File 'lib/varanus/dcv.rb', line 33 def status domain _format_status(post('dcv/v2/validation/status', domain: domain)) end |
#submit(domain, type, email_address = nil) ⇒ Object
Submit domain validation for verficiation. This must be called after #start
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/varanus/dcv.rb', line 43 def submit domain, type, email_address = nil if type.to_s == 'email' raise ArgumentError, 'email_address must be specified' if email_address.nil? post('dcv/v1/validation/submit/domain/email', domain: domain, email: email_address) else post("dcv/v1/validation/submit/domain/#{type}", domain: domain) end end |