Module: Eco::Data::Locations::NodeBase::Serial
- Included in:
- Builder
- Defined in:
- lib/eco/data/locations/node_base/serial.rb
Instance Attribute Summary
Attributes included from Language::AuxiliarLogger
Instance Method Summary collapse
-
#nodes_to_csv_list(nodes) ⇒ CSV::Table
Ready to dump into a nodes list csv (rows are nodes; a column holds
parent_id
). -
#nodes_to_csv_tree(nodes) ⇒ CSV::Table
Ready to dump into a hierarhical csv (columns are tree levels).
-
#serializer(item) ⇒ Proc
The serializer to be used.
Methods included from Convert
#csv_from, #empty_array, #empty_level_tracker_hash, #hash_tree_to_tree_csv, #log_pretty_inspect, #normalize_arrays, #report_repeated_node_ids
Methods included from Language::AuxiliarLogger
Methods included from Treeify
Instance Method Details
#nodes_to_csv_list(nodes) ⇒ CSV::Table
Returns ready to dump into a nodes list csv (rows are nodes; a column holds parent_id
).
21 22 23 24 |
# File 'lib/eco/data/locations/node_base/serial.rb', line 21 def nodes_to_csv_list(nodes) tree = Eco::API::Organization::TagTree.new(treeify(nodes)) Eco::CSV::Table.new(tree.as_nodes_json) end |
#nodes_to_csv_tree(nodes) ⇒ CSV::Table
Returns ready to dump into a hierarhical csv (columns are tree levels).
15 16 17 |
# File 'lib/eco/data/locations/node_base/serial.rb', line 15 def nodes_to_csv_tree(nodes) hash_tree_to_tree_csv(treeify(nodes)) end |