Class: Orchestrate::Graph

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestrate/graph.rb

Overview

Manages graph relationships for a KeyValue item.

Defined Under Namespace

Classes: RelationStem

Instance Method Summary collapse

Constructor Details

#initialize(kv_item) ⇒ Graph

Instantiates a new Graph manager.

Parameters:


8
9
10
11
# File 'lib/orchestrate/graph.rb', line 8

def initialize(kv_item)
  @kv_item = kv_item
  @types = {}
end

Instance Method Details

#[](relation_type) ⇒ RelationStem

Accessor for graph relation types.

Returns:


15
16
17
# File 'lib/orchestrate/graph.rb', line 15

def [](relation_type)
  @types[relation_type.to_s] || RelationStem.new(@kv_item, relation_type.to_s)
end