Class: FiasReader::Table
- Inherits:
-
Object
show all
- Defined in:
- lib/fias_reader/table.rb,
lib/fias_reader/table/house.rb,
lib/fias_reader/table/address_part.rb
Overview
Инерфейс для работы XML с базой ФИАС
Defined Under Namespace
Classes: AddressPart, House
Constant Summary
collapse
- LOGICS =
[
ParseLogic::Depth,
ParseLogic::Rows,
ParseLogic::Attributes
].freeze
Instance Method Summary
collapse
Constructor Details
#initialize(reader) ⇒ Table
9
10
11
|
# File 'lib/fias_reader/table.rb', line 9
def initialize(reader)
@reader = reader
end
|
Instance Method Details
#file ⇒ Object
17
18
19
|
# File 'lib/fias_reader/table.rb', line 17
def file
File.new(file_path, 'r')
end
|
#file_path ⇒ Object
21
22
23
24
25
26
|
# File 'lib/fias_reader/table.rb', line 21
def file_path
Dir[
"#{@reader.path}/#{self.class::File}_*.XML",
"#{@reader.path}/#{self.class::File}_*.xml"
].first
end
|
#query ⇒ Object
13
14
15
|
# File 'lib/fias_reader/table.rb', line 13
def query
FiasReader::Scope.new(self)
end
|