Skip to content

MetaStruct - a collection of strongly business-oriented variants of commonly used data structures such as graphs, lists and etc.

License

Notifications You must be signed in to change notification settings

elenik72/meta_struct

This branch is up to date with 0exp/meta_struct:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5dcdcc0 · Oct 26, 2020

History

34 Commits
Oct 17, 2020
Oct 26, 2020
Oct 25, 2020
Oct 17, 2020
Oct 17, 2020
Oct 25, 2020
Oct 17, 2020
Oct 17, 2020
Oct 18, 2020
Oct 17, 2020
Oct 25, 2020
Oct 17, 2020
Oct 18, 2020

Repository files navigation

MetaStruct

MetaStruct - a collection of strongly business-oriented variants of commonly used data structures such as graphs, lists and etc.


Table of usage


MetaStruct::Graph

MetaStruct::Graph - directed acyclic graph. Realized as a representational data structure (without mutation interfaces).


Graph Invariants:

  • has only one root node;
  • has no non-connected nodes;
  • has no cycles (in development);
  • has exit (at least one);

Graph Creation

  • create node MetaStruct::Graph::Node:
MetaStruct::Graph::Node.create(
  uuid: _your_uuid_, # autogenerated via SecureRandom.uuid by default
  labels: _your_labels_, # [] by default
  properties: _your_properties_ # {} by default
)
  • create edge MetaStruct::Graph::Edge:
MetaStruct::Graph::Edge.create(
  left_node: _your_left_node_, # an instance of MetaStruct::Graph::Node
  right_node: _your_right_node_, # an instance of MetaStruct::Graph::Node
  labels: _your_labels_, # [] by default
  properties: _your_properties_, # {} by default
  weight: _your_weight_ # 0 by default
)
  • build graph MetaStruct::Graph:
    • fails on duplicated nodes (nodes with duplicated uuids);
    • fails on duplicated edges (duplicated edge objects wich have identical left and right nodes);
    • fails on situation, when node has no edge entity (presented in edge list);
    • fails on situation, when edge has node which is not presented in node list;
MetaStruct::Graph.create(
  nodes: _your_array_of_nodes_, # [] by default
  edges: _your_array_of_edges # [] by default
)

Contributing

  • Fork it ( https://github.com/0exp/meta_struct/fork )
  • Create your feature branch (git checkout -b feature/my-new-feature)
  • Commit your changes (git commit -am '[my-new-featre] Add some feature')
  • Push to the branch (git push origin feature/my-new-feature)
  • Create new Pull Request

License

Released under MIT License.

Authors

Rustam Ibragimov

About

MetaStruct - a collection of strongly business-oriented variants of commonly used data structures such as graphs, lists and etc.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.8%
  • Shell 0.2%