Class: Lono::Importer::Converter
- Inherits:
-
Object
- Object
- Lono::Importer::Converter
- Includes:
- Download
- Defined in:
- lib/lono/importer/converter.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Converter
constructor
source is a path.
- #run ⇒ Object
Methods included from Download
#download_template, #json?, #read_source
Constructor Details
#initialize(options = {}) ⇒ Converter
source is a path
6 7 8 9 |
# File 'lib/lono/importer/converter.rb', line 6 def initialize(={}) @options = @source = [:source] end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/lono/importer/converter.rb', line 11 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 |