Class: Fias::Query::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/fias/query/params.rb

Constant Summary collapse

KEYS =
%i(street subcity city district region)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Params

Returns a new instance of Params.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fias/query/params.rb', line 6

def initialize(params)
  @params = params
  @params.assert_valid_keys(*KEYS)

  extract_names
  remove_duplicates
  move_federal_city_to_correct_place
  strip_house_number
  sort
  extract_synonyms
  split_sanitized
  fill_forms
end

Instance Attribute Details

#formsObject (readonly)

Returns the value of attribute forms.



20
21
22
# File 'lib/fias/query/params.rb', line 20

def forms
  @forms
end

#paramsObject (readonly)

Returns the value of attribute params.



20
21
22
# File 'lib/fias/query/params.rb', line 20

def params
  @params
end

#sanitizedObject (readonly)

Returns the value of attribute sanitized.



20
21
22
# File 'lib/fias/query/params.rb', line 20

def sanitized
  @sanitized
end

#splitObject (readonly)

Returns the value of attribute split.



20
21
22
# File 'lib/fias/query/params.rb', line 20

def split
  @split
end

#synonymsObject (readonly)

Returns the value of attribute synonyms.



20
21
22
# File 'lib/fias/query/params.rb', line 20

def synonyms
  @synonyms
end