Class: AddressFinder::AddressSearch

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

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params:, http:) ⇒ AddressSearch

Returns a new instance of AddressSearch.



8
9
10
11
12
13
14
15
# File 'lib/addressfinder/address_search.rb', line 8

def initialize(params:, http:)
  @http = http
  @country = params.delete(:country) || config.default_country

  @params = params
  @params[:key] ||= config.api_key
  @params[:secret] ||= config.api_secret
end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



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

def results
  @results
end

Instance Method Details

#performObject



17
18
19
20
21
22
23
# File 'lib/addressfinder/address_search.rb', line 17

def perform
  build_request
  execute_request
  build_result

  self
end