Class: Dadatas::Suggestion

Inherits:
Object
  • Object
show all
Defined in:
lib/dadatas/suggestion.rb

Overview

Suggestion API

Constant Summary collapse

BASE_URL =
'https://suggestions.dadata.ru/suggestions/api/4_1/rs/'
TYPES =
{
  address: 'suggest/address',
  city_by_ip: 'iplocate/address',
  bank: 'findById/bank',
  organization: 'suggest/party',
  address_by_str: 'suggest/address',
  country: 'suggest/country',
  address_by_geo: 'geolocate/address'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Suggestion

Returns a new instance of Suggestion.



23
24
25
# File 'lib/dadatas/suggestion.rb', line 23

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



21
22
23
# File 'lib/dadatas/suggestion.rb', line 21

def config
  @config
end

Instance Method Details

#address_by_fias_id(fias_id: nil) ⇒ Object



33
34
35
# File 'lib/dadatas/suggestion.rb', line 33

def address_by_fias_id(fias_id: nil)
  call_method('findById/address', query: fias_id)
end