Class: Mementus::NodeProxy
- Inherits:
-
Object
- Object
- Mementus::NodeProxy
- Defined in:
- lib/mementus/node_proxy.rb
Instance Method Summary collapse
- #[](prop) ⇒ Object
- #each_adjacent(&block) ⇒ Object
- #id ⇒ Object
- #in(match = nil) ⇒ Object
- #in_e(match = nil) ⇒ Object
- #incoming(match = nil) ⇒ Object
- #incoming_edges(match = nil) ⇒ Object
-
#initialize(node, graph) ⇒ NodeProxy
constructor
A new instance of NodeProxy.
- #label ⇒ Object
- #out(match = nil) ⇒ Object
- #out_e(match = nil) ⇒ Object
- #outgoing(match = nil) ⇒ Object
- #outgoing_edges(match = nil) ⇒ Object
- #props ⇒ Object
Constructor Details
#initialize(node, graph) ⇒ NodeProxy
Returns a new instance of 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
40 41 42 |
# File 'lib/mementus/node_proxy.rb', line 40 def each_adjacent(&block) @graph.each_adjacent(@node.id, &block) end |
#id ⇒ Object
8 9 10 |
# File 'lib/mementus/node_proxy.rb', line 8 def id @node.id end |
#in(match = nil) ⇒ Object
32 33 34 |
# File 'lib/mementus/node_proxy.rb', line 32 def in(match=nil) Pipeline::Step.new([self], Pipeline::Pipe.new(@graph), @graph).in(match) end |
#in_e(match = nil) ⇒ Object
36 37 38 |
# File 'lib/mementus/node_proxy.rb', line 36 def in_e(match=nil) Pipeline::Step.new([self], Pipeline::Pipe.new(@graph), @graph).in_e(match) end |
#incoming(match = nil) ⇒ Object
48 49 50 |
# File 'lib/mementus/node_proxy.rb', line 48 def incoming(match=nil) @graph.incoming(@node.id, match) end |
#incoming_edges(match = nil) ⇒ Object
56 57 58 |
# File 'lib/mementus/node_proxy.rb', line 56 def incoming_edges(match=nil) @graph.incoming_edges(@node.id, match) end |
#label ⇒ Object
12 13 14 |
# File 'lib/mementus/node_proxy.rb', line 12 def label @node.label end |
#out(match = nil) ⇒ Object
24 25 26 |
# File 'lib/mementus/node_proxy.rb', line 24 def out(match=nil) Pipeline::Step.new([self], Pipeline::Pipe.new(@graph), @graph).out(match) end |
#out_e(match = nil) ⇒ Object
28 29 30 |
# File 'lib/mementus/node_proxy.rb', line 28 def out_e(match=nil) Pipeline::Step.new([self], Pipeline::Pipe.new(@graph), @graph).out_e(match) end |
#outgoing(match = nil) ⇒ Object
44 45 46 |
# File 'lib/mementus/node_proxy.rb', line 44 def outgoing(match=nil) @graph.outgoing(@node.id, match) end |
#outgoing_edges(match = nil) ⇒ Object
52 53 54 |
# File 'lib/mementus/node_proxy.rb', line 52 def outgoing_edges(match=nil) @graph.outgoing_edges(@node.id, match) end |
#props ⇒ Object
20 21 22 |
# File 'lib/mementus/node_proxy.rb', line 20 def props @node.props end |