Class: Anchor::TypeScript::MultifileSaveService
- Inherits:
-
Object
- Object
- Anchor::TypeScript::MultifileSaveService
- Defined in:
- lib/anchor/type_script/multifile_save_service.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(generator:, folder_path:, force: false, trust_hash: true) ⇒ MultifileSaveService
constructor
A new instance of MultifileSaveService.
Constructor Details
#initialize(generator:, folder_path:, force: false, trust_hash: true) ⇒ MultifileSaveService
Returns a new instance of MultifileSaveService.
7 8 9 10 11 12 |
# File 'lib/anchor/type_script/multifile_save_service.rb', line 7 def initialize(generator:, folder_path:, force: false, trust_hash: true) @generator = generator @folder_path = folder_path @force = force @trust_hash = trust_hash end |
Class Method Details
.call ⇒ Object
3 4 5 |
# File 'lib/anchor/type_script/multifile_save_service.rb', line 3 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/anchor/type_script/multifile_save_service.rb', line 14 def call FileUtils.mkdir_p(@folder_path) results = @generator.call modified_files = results.filter_map { |result| save_result(result) } save_sha modified_files end |