Class: CodePages::Importer
- Inherits:
-
Object
- Object
- CodePages::Importer
- Defined in:
- lib/code-pages/importer.rb
Instance Attribute Summary collapse
-
#manifest ⇒ Object
readonly
Returns the value of attribute manifest.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Class Method Summary collapse
Instance Method Summary collapse
- #import ⇒ Object
-
#initialize(manifest, output_path) ⇒ Importer
constructor
A new instance of Importer.
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
#manifest ⇒ Object (readonly)
Returns the value of attribute manifest.
10 11 12 |
# File 'lib/code-pages/importer.rb', line 10 def manifest @manifest end |
#output_path ⇒ Object (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
#import ⇒ Object
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 |