Class: Fias::Import::Tables
- Inherits:
-
Object
- Object
- Fias::Import::Tables
- Defined in:
- lib/fias/import/tables.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Instance Method Summary collapse
- #copy ⇒ Object
- #create ⇒ Object
-
#initialize(db, files, prefix = DEFAULT_PREFIX) ⇒ Tables
constructor
A new instance of Tables.
Constructor Details
#initialize(db, files, prefix = DEFAULT_PREFIX) ⇒ Tables
Returns a new instance of Tables.
4 5 6 7 8 |
# File 'lib/fias/import/tables.rb', line 4 def initialize(db, files, prefix = DEFAULT_PREFIX) @db = db @files = files @prefix = prefix end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
10 11 12 |
# File 'lib/fias/import/tables.rb', line 10 def files @files end |
Instance Method Details
#copy ⇒ Object
19 20 21 22 23 |
# File 'lib/fias/import/tables.rb', line 19 def copy @files.map do |name, dbf| Copy.new(@db, table_name(name), dbf, uuid_column_types(name)) end end |
#create ⇒ Object
12 13 14 15 16 17 |
# File 'lib/fias/import/tables.rb', line 12 def create @files.each do |name, dbf| next if dbf.blank? create_table(name, dbf) end end |