Class: BriteVerifyApi::Clients::Email

Inherits:
Base
  • Object
show all
Defined in:
lib/brite_verify_api/clients/email.rb

Constant Summary collapse

API_PATH =
"/emails.json".freeze

Constants inherited from Base

Base::API_HOST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#get

Constructor Details

#initialize(email = nil) ⇒ Email

Returns a new instance of Email.



7
8
9
# File 'lib/brite_verify_api/clients/email.rb', line 7

def initialize(email = nil)
  @email = email
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/brite_verify_api/clients/email.rb', line 5

def email
  @email
end

Instance Method Details

#verifyObject



11
12
13
14
15
16
17
18
19
# File 'lib/brite_verify_api/clients/email.rb', line 11

def verify
  unless BriteVerifyApi.configuration.default_email_api_reponse.nil?
    return RecursiveOpenStruct.new(
      BriteVerifyApi.configuration.default_email_api_reponse,
    )
  end
  options = { address: email }
  get path, options
end