Sha256: bf4678545e799bc1532746233cf432d3ee7acd63bd0c0be6c5e088e2c824f681
Contents?: true
Size: 1.62 KB
Versions: 22
Compression:
Stored size: 1.62 KB
Contents
module Eco::API::UseCases::GraphQL::Samples module Location::Service # Service to transform (CONVERT or PARSE) an input locations structure into a list # of hash nodes. # @note it can have multiple usages # 1. Live locations tree structure into a nodes list file (nodeId, parendId, name,...) # 2. A locations tree built from an input csv into a nodes list hash # 3. Change the keys of the hash nodes # 4. Parse the values # @note this use case can be inherited from to provision **parsed** input to other # use cases. # @note 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` # As this format allows to easily compare what has changed in the locations structure. # @example # class Custom::UseCase::TagtreeToList < Eco::API::UseCases::GraphQL::Samples::Location # name 'tagtree-to-list' # type :other # # include Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList # # end module TreeToList include Eco::API::UseCases::GraphQL::Samples::Location::DSL require_relative 'tree_to_list/output' require_relative 'tree_to_list/converter' include Output include Converter def process 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 end end
Version data entries
22 entries across 22 versions & 1 rubygems