Module: Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList
- Included in:
- TreeDiff
- Defined in:
- lib/eco/api/usecases/graphql/samples/location/service/tree_to_list.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/output.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter/input.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter/parser.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter/discarded.rb,
lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter/node_attr_maps.rb
Overview
it can have multiple usages
- Live locations tree structure into a nodes list file (nodeId, parendId, name,...)
- A locations tree built from an input csv into a nodes list hash
- Change the keys of the hash nodes
- Parse the values
this use case can be inherited from to provision parsed input to other use cases.
it allows to define custom_node_parser
and custom_node_parser_after
methods (param: node_hash
), to allow custom parsing.
- It has a generic parser that validates the
classifications
Service to transform (CONVERT or PARSE) an input locations structure into a list of hash nodes. As this format allows to easily compare what has changed in the locations structure.
Defined Under Namespace
Constant Summary
Constants included from Converter::Discarded
Converter::Discarded::DISCARDED_NODES
Constants included from Converter::NodeAttrMaps
Converter::NodeAttrMaps::NODE_ATTR_MAPS
Constants included from Helpers::Location::Base::TreeTracking
Helpers::Location::Base::TreeTracking::TAGTREE_BACKUP
Constants included from Output
Output::OUT_FILENAME, Output::OUT_FOLDER, Output::OUT_HEADER, Output::OUT_TIME_FORMAT
Instance Attribute Summary
Attributes included from Helpers::Base::ErrorHandling
Attributes included from Language::AuxiliarLogger
Attributes included from Helpers::Location::Base::TreeTracking
Instance Method Summary collapse
Methods included from Helpers::Location::Base
#live_tree, #session_live_tree, #tagtree_id, #target_structure_id, #target_structure_id_const
Methods included from Language::AuxiliarLogger
Methods included from Helpers::Location::Base::TreeTracking
#backup_tree, #track_current_tree, #track_current_tree?
Instance Method Details
#process ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/eco/api/usecases/graphql/samples/location/service/tree_to_list.rb', line 33 def process with_error_handling do as_nodes_json(input_tagtree).tap do |list| next generate_live_nodes_file(list) unless list.empty? log(:error) { "There are no location nodes!" } end end end |