Class: CodePages::Importer

Inherits:
Object
  • Object
show all
Defined in:
lib/code-pages/importer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(manifest, output_path) ⇒ Importer

Returns a new instance of Importer.



12
13
14
15
# File 'lib/code-pages/importer.rb', line 12

def initialize(manifest, output_path)
  @manifest = manifest
  @output_path = output_path
end

Instance Attribute Details

#manifestObject (readonly)

Returns the value of attribute manifest.



10
11
12
# File 'lib/code-pages/importer.rb', line 10

def manifest
  @manifest
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



10
11
12
# File 'lib/code-pages/importer.rb', line 10

def output_path
  @output_path
end

Class Method Details

.import(manifest, output_path) ⇒ Object



6
7
8
# File 'lib/code-pages/importer.rb', line 6

def self.import(manifest, output_path)
  new(manifest, output_path).import
end

Instance Method Details

#importObject



17
18
19
20
21
22
23
# File 'lib/code-pages/importer.rb', line 17

def import
  manifest.each do |props|
    STDOUT.write("Importing #{props['name']}... ")
    import_code_page(props)
    puts 'done.'
  end
end