class Verifalia::REST::Client

Once you have a client object you can use it to do fun things. Every client object exposes a wrapper for a specific API. For example:

@client.email_validations

Constants

API_VERSION
DEFAULTS

Attributes

account_sid[R]
account_token[R]

Public Class Methods

new(*args) click to toggle source

Instantiate a new HTTP client to talk to Verifalia. The parameters account_sid and auth_token are required, unless you have configured them already using the block configure syntax, and used to generate the HTTP basic auth header in each request. The args parameter is a hash of connection configuration options. the following keys are supported:

host: 'https://api.verifalia.com'

api_version: 'v1.1'

   # File lib/rest/client.rb
45 def initialize(*args)
46   options = args.last.is_a?(Hash) ? args.pop : {}
47   @config = DEFAULTS.merge! options
48   @account_sid = args[0] || Verifalia.account_sid
49   @auth_token = args[1] || Verifalia.auth_token
50 
51   if @account_sid.nil? || @auth_token.nil?
52     raise ArgumentError, 'Account SID and auth token are required'
53   end
54 
55 end

Public Instance Methods

account_balance() click to toggle source

Instantiate a new HTTP client to talk to Verifalia Account Balance Api.

   # File lib/rest/client.rb
77 def account_balance()
78   @account_balance ||= AccountBalance.new @config, @account_sid, @auth_token
79 end
email_validations(args = {}) click to toggle source

Instantiate a new HTTP client to talk to Verifalia Email Validation Api. The args parameter is a hash of configuration The following keys are supported:

unique_id: 'example-example'

The unique if of the Verifalia Email Validation resource

   # File lib/rest/client.rb
66 def email_validations(args = {})
67   if (args.empty?)
68     @email_validations ||= EmailValidations.new @config, @account_sid, @auth_token
69   else
70     EmailValidations.new @config, @account_sid, @auth_token, args
71   end
72 end