Module: Eco::API::UseCases::GraphQL::Samples::Location::Command::DSL
- Includes:
- Helpers::Location::Command, Results
- Defined in:
- lib/eco/api/usecases/graphql/samples/location/command/dsl.rb
Constant Summary
Constants included from Helpers::Location::Base
Helpers::Location::Base::TAGTREE_BACKUP
Constants included from Helpers::Location::Command
Helpers::Location::Command::COMMANDS_PER_PAGE, Helpers::Location::Command::FORCE_CONTINUE
Instance Attribute Summary
Attributes included from Results
#error, #exception, #tags_remap_csv_file
Attributes included from Helpers::Location::Base
Attributes included from Helpers::Base
Attributes included from Language::AuxiliarLogger
Instance Method Summary collapse
- #inputs(*args, force_continue: force_continue?, , **kargs, &block) ⇒ Object
-
#process ⇒ Object
Main processor.
Methods included from Results
#generate_tags_remap_csv, #page_errors?, #request_results_class, #rescued, #results, #tags_remap_table, #timestamp_file, #update_tags_remap_table
Methods included from Helpers::Location::Base
#backup_tree, #live_tree, #tagtree_id, #target_structure_id, #track_current_tree
Methods included from Helpers::Base
#backup, #config, #exit_error, #graphql, #simulate?
Methods included from Language::AuxiliarLogger
Methods included from Helpers::Location::Command
#commands_per_page, #force_continue?, #input, #sliced_batches, #with_sliced_input
Instance Method Details
#inputs(*args, force_continue: force_continue?, , **kargs, &block) ⇒ Object
18 19 20 21 22 |
# File 'lib/eco/api/usecases/graphql/samples/location/command/dsl.rb', line 18 def inputs(*args, force_continue: force_continue?, **kargs, &block) msg = "You should implement this method in your child class.\n" msg << "Which should yield the input Hash and the stage or descriptor." raise Eco::API::UseCases::GraphQL::Base::NotImplementedMethod, msg end |
#process ⇒ Object
Main processor
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/eco/api/usecases/graphql/samples/location/command/dsl.rb', line 25 def process begin super if defined?(super) rescue Eco::API::UseCases::GraphQL::Base::NotImplementedMethod end self.error = false # this triggers a backup of the tagtree self.current_tree ||= live_tree inputs(force_continue: force_continue?) do |input, stage| results[stage] ||= [] sliced_batches(input, desc: stage) do |sliced_input, response, page, pages, done, total| track_current_tree(response&.structure) page_results = nil results[stage] << (page_results = request_results_class.new(sliced_input, response)) (page_results, stage) break if self.error = page_errors?(page_results, page, pages, done, total, stage: stage) end break if error end rescue StandardError => e log(:error) { self.exception ||= e. } raise ensure rescued { self. = } end |