Class: Mementus::NodeProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/mementus/node_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(node, graph) ⇒ NodeProxy



3
4
5
6
# File 'lib/mementus/node_proxy.rb', line 3

def initialize(node, graph)
  @node = node
  @graph = graph
end

Instance Method Details

#[](prop) ⇒ Object



16
17
18
# File 'lib/mementus/node_proxy.rb', line 16

def [](prop)
  @node[prop]
end

#each_adjacent(&block) ⇒ Object



32
33
34
# File 'lib/mementus/node_proxy.rb', line 32

def each_adjacent(&block)
  @graph.each_adjacent(@node.id, &block)
end

#idObject



8
9
10
# File 'lib/mementus/node_proxy.rb', line 8

def id
  @node.id
end

#incoming(match = nil) ⇒ Object



40
41
42
# File 'lib/mementus/node_proxy.rb', line 40

def incoming(match=nil)
  @graph.incoming(@node.id, match)
end

#labelObject



12
13
14
# File 'lib/mementus/node_proxy.rb', line 12

def label
  @node.label
end

#outObject



24
25
26
# File 'lib/mementus/node_proxy.rb', line 24

def out
  Pipeline::Step.new([self], Pipeline::Pipe.new(@graph), @graph).out_e
end

#out_eObject



28
29
30
# File 'lib/mementus/node_proxy.rb', line 28

def out_e
  Pipeline::Step.new([self], Pipeline::Pipe.new(@graph), @graph).out_e
end

#outgoing(match = nil) ⇒ Object



36
37
38
# File 'lib/mementus/node_proxy.rb', line 36

def outgoing(match=nil)
  @graph.outgoing(@node.id, match)
end

#outgoing_edges(match = nil) ⇒ Object

TODO: Fix



45
46
47
# File 'lib/mementus/node_proxy.rb', line 45

def outgoing_edges(match=nil)
  @graph.outgoing_edges(@node.id, match)
end

#propsObject



20
21
22
# File 'lib/mementus/node_proxy.rb', line 20

def props
  @node.props
end