Class: Lono::Pro::Importer::Converter
- Inherits:
-
Object
- Object
- Lono::Pro::Importer::Converter
- Includes:
- Download
- Defined in:
- lib/lono/pro/importer/converter.rb
Instance Method Summary collapse
-
#initialize(source, options = {}) ⇒ Converter
constructor
source is a path.
- #run ⇒ Object
Methods included from Download
#download_template, #json?, #read_source
Constructor Details
#initialize(source, options = {}) ⇒ Converter
source is a path
6 7 8 |
# File 'lib/lono/pro/importer/converter.rb', line 6 def initialize(source, ={}) @source, @options = source, end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/lono/pro/importer/converter.rb', line 10 def run tmp_path = "/tmp/lono/import/template.yml" tmp_template_path = download_template(@source, tmp_path) template = IO.read(tmp_template_path) coder = Service::Coder.new(template, @options) coder.translate end |