Class: Mementus::NodeProxy
- Inherits:
-
Object
- Object
- Mementus::NodeProxy
- Defined in:
- lib/mementus/node_proxy.rb
Instance Method Summary collapse
- #[](prop) ⇒ Object
- #adjacent ⇒ Object
- #adjacent_edges ⇒ Object
- #each_adjacent(&block) ⇒ Object
- #id ⇒ Object
-
#initialize(node, graph) ⇒ NodeProxy
constructor
A new instance of NodeProxy.
- #label ⇒ Object
- #out_e ⇒ 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 |
#adjacent ⇒ Object
32 33 34 |
# File 'lib/mementus/node_proxy.rb', line 32 def adjacent @graph.adjacent(@node.id) end |
#adjacent_edges ⇒ Object
36 37 38 |
# File 'lib/mementus/node_proxy.rb', line 36 def adjacent_edges @graph.adjacent_edges(@node.id) end |
#each_adjacent(&block) ⇒ Object
28 29 30 |
# File 'lib/mementus/node_proxy.rb', line 28 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 |
#label ⇒ Object
12 13 14 |
# File 'lib/mementus/node_proxy.rb', line 12 def label @node.label end |
#out_e ⇒ Object
24 25 26 |
# File 'lib/mementus/node_proxy.rb', line 24 def out_e Pipeline::Step.new(adjacent_edges, Pipeline::Pipe.new(@graph), @graph) end |
#props ⇒ Object
20 21 22 |
# File 'lib/mementus/node_proxy.rb', line 20 def props @node.props end |