Class: Zt::Importers::Importer
- Inherits:
-
Object
- Object
- Zt::Importers::Importer
- Defined in:
- lib/zt/importers.rb
Instance Attribute Summary collapse
-
#importers ⇒ Object
Returns the value of attribute importers.
Instance Method Summary collapse
-
#import ⇒ Array[Hash]
NOTE there may be value in attributing each hash to its importer, consider that for later as a Hash.
-
#initialize(networks, nodes, *importer_names) ⇒ Importer
constructor
A new instance of Importer.
Constructor Details
#initialize(networks, nodes, *importer_names) ⇒ Importer
Returns a new instance of Importer.
12 13 14 15 16 17 18 |
# File 'lib/zt/importers.rb', line 12 def initialize(networks, nodes, *importer_names) importer_names = Zt::Constants::ALL_IMPORTERS if importer_names.empty? importer_classes = importer_names.map do |n| Zt::Importers.const_get(n) end @importers = importer_classes.map { |c| c.new(networks, nodes) } end |
Instance Attribute Details
#importers ⇒ Object
Returns the value of attribute importers.
11 12 13 |
# File 'lib/zt/importers.rb', line 11 def importers @importers end |
Instance Method Details
#import ⇒ Array[Hash]
NOTE there may be value in attributing each hash to its importer, consider that for later as a Hash.
23 24 25 |
# File 'lib/zt/importers.rb', line 23 def import @importers.map(&:import) end |