Class: Dadata::Suggestion
- Inherits:
-
Object
- Object
- Dadata::Suggestion
- Defined in:
- lib/dadata/suggestion.rb
Overview
Suggestion API
Constant Summary collapse
- BASE_URL =
'https://suggestions.dadata.ru/suggestions/api/4_1/rs/'
Instance Method Summary collapse
- #address_by_fias_id(fias_id: nil) ⇒ Object
- #address_by_str(query: nil) ⇒ Object
-
#initialize(config) ⇒ Suggestion
constructor
A new instance of Suggestion.
- #organization(query: nil) ⇒ Object
Constructor Details
#initialize(config) ⇒ Suggestion
Returns a new instance of Suggestion.
11 12 13 |
# File 'lib/dadata/suggestion.rb', line 11 def initialize(config) @config = config end |
Instance Method Details
#address_by_fias_id(fias_id: nil) ⇒ Object
19 20 21 |
# File 'lib/dadata/suggestion.rb', line 19 def address_by_fias_id(fias_id: nil) call_method('findById/address', query: fias_id) end |
#address_by_str(query: nil) ⇒ Object
23 24 25 |
# File 'lib/dadata/suggestion.rb', line 23 def address_by_str(query: nil) call_method('suggest/address', query: query) end |
#organization(query: nil) ⇒ Object
15 16 17 |
# File 'lib/dadata/suggestion.rb', line 15 def organization(query: nil) call_method('suggest/party', query: query) end |