Class: Mementus::EdgeProxy

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

Instance Method Summary collapse

Constructor Details

#initialize(edge, graph) ⇒ EdgeProxy

Returns a new instance of EdgeProxy.



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

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

Instance Method Details

#[](prop) ⇒ Object



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

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

#fromObject



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

def from
  @graph.node(@edge.from.id)
end

#idObject



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

def id
  @edge.id
end

#labelObject



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

def label
  @edge.label
end

#propsObject



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

def props
  @edge.props
end

#toObject



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

def to
  @graph.node(@edge.to.id)
end