Class: AddressFinder::V1::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/addressfinder/v1/base.rb

Direct Known Subclasses

Email::Verification, Phone::Verification

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params:, path:, http:) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
13
14
15
16
17
# File 'lib/addressfinder/v1/base.rb', line 8

def initialize(params:, path:, http:)
  @params = params
  @params[:domain] ||= config.domain if config.domain
  @params[:key] ||= config.api_key
  @params[:secret] ||= config.api_secret
  @params[:format] ||= 'json'

  @path = path
  @http = http
end

Instance Attribute Details

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/addressfinder/v1/base.rb', line 6

def result
  @result
end

Instance Method Details

#performObject



19
20
21
22
23
24
25
# File 'lib/addressfinder/v1/base.rb', line 19

def perform
  build_request
  execute_request
  build_result

  self
end