neo4j-core 3.0.0.alpha.5 → 3.0.0.alpha.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b8d26b2492ff2888f2c2606aeee0ce9255a1258
4
- data.tar.gz: f7fc8825fd0e49e7fa76165fef2c9e2610cb206e
3
+ metadata.gz: 0169ab5b121c40e20ed52eef9788cf4f18f46c2a
4
+ data.tar.gz: 3d193639061208fe216802c04d420faa20b9e0a9
5
5
  SHA512:
6
- metadata.gz: 54c8b882ea08e8c2e9ea63a5c641e17d5ea84b247a1fb5c6b3b345bb7fb449ff03ee608a80639f82c2e57aa763a15286f94b29b2d895f9ec1eb0dc80fb2a9bde
7
- data.tar.gz: 119921f81ce0918cc3273db1cccc89a50c5543024d2d0b80bacaeb36438541785579a293da8ca14839ecbd0dcfea6b44ba48958ca1ad4eb370883832ec443bb7
6
+ metadata.gz: a1d763665cbe45cfff3765e46d9346e21c379ea0f65930a3405a90632bdd59e8139318fd4a4e15dd3b41795c9d57e87f751ea81dfef365fe7dce3a449bb61d8b
7
+ data.tar.gz: 85e2bf6b4819f47556b5a33e137bc9980226f75a5c95aa0375e24734f231c1c49af269fcd0962556a1d58100a3b2aa356f91b7384db322a3622701a70ee14e8e
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = "3.0.0.alpha.5"
3
+ VERSION = "3.0.0.alpha.6"
4
4
  end
5
5
  end
@@ -19,10 +19,14 @@ module Neo4j::Embedded
19
19
  tx_methods :exist?
20
20
 
21
21
  def start_node
22
- getStartNode.wrapper
22
+ _start_node.wrapper
23
23
  end
24
24
  tx_methods :start_node
25
25
 
26
+ def _start_node
27
+ getStartNode
28
+ end
29
+
26
30
  def del
27
31
  delete
28
32
  end
@@ -31,12 +35,17 @@ module Neo4j::Embedded
31
35
  def other_node(n)
32
36
  _other_node(n.neo4j_obj).wrapper
33
37
  end
38
+ tx_methods :other_node
34
39
 
35
40
  def end_node
36
- getEndNode.wrapper
41
+ _end_node.wrapper
37
42
  end
38
43
  tx_methods :end_node
39
44
 
45
+ def _end_node
46
+ getEndNode
47
+ end
48
+
40
49
  end
41
50
  end
42
51
  end
@@ -29,16 +29,16 @@ module Neo4j::Server
29
29
  end
30
30
  end
31
31
 
32
- def start_node
32
+ def _start_node
33
33
  load_resource
34
34
  id = resource_url_id(resource_url(:start))
35
- Neo4j::Node.load(id)
35
+ Neo4j::Node._load(id)
36
36
  end
37
37
 
38
- def end_node
38
+ def _end_node
39
39
  load_resource
40
40
  id = resource_url_id(resource_url(:end))
41
- Neo4j::Node.load(id)
41
+ Neo4j::Node._load(id)
42
42
  end
43
43
 
44
44
  def get_property(key)
data/lib/neo4j/node.rb CHANGED
@@ -162,10 +162,16 @@ module Neo4j
162
162
 
163
163
  # Loads a node from the database with given id
164
164
  def load(neo_id, session = Neo4j::Session.current)
165
- node = session.load_node(neo_id)
165
+ node = _load(neo_id, session)
166
166
  node && node.wrapper
167
167
  end
168
168
 
169
+ # Same as #load but does not try to return a wrapped node
170
+ # @return [Neo4j::Node] an unwrapped node
171
+ def _load(neo_id, session = Neo4j::Session.current)
172
+ session.load_node(neo_id)
173
+ end
174
+
169
175
  # Checks if the given entity node or entity id (Neo4j::Node#neo_id) exists in the database.
170
176
  # @return [true, false] if exist
171
177
  def exist?(entity_or_entity_id, session = Neo4j::Session.current)
@@ -22,13 +22,27 @@ module Neo4j
22
22
  include EntityEquality
23
23
  include Wrapper
24
24
 
25
- # @abstract
25
+ # Returns the start node of this relationship.
26
+ # @return [Neo4j::Node,Object] the node or wrapped node
26
27
  def start_node
28
+ _start_node.wrapper
29
+ end
30
+
31
+ # Same as #start_node but does not wrap the node
32
+ # @returns [Neo4j::Node]
33
+ def _start_node
27
34
  raise 'not implemented'
28
35
  end
29
36
 
30
- # @abstract
37
+ # Returns the end node of this relationship.
38
+ # @return [Neo4j::Node,Object] the node or wrapped node
31
39
  def end_node
40
+ _end_node.wrapper
41
+ end
42
+
43
+ # Same as #end_node but does not wrap the node
44
+ # @returns [Neo4j::Node]
45
+ def _end_node
32
46
  raise 'not implemented'
33
47
  end
34
48
 
@@ -79,10 +93,12 @@ module Neo4j
79
93
 
80
94
  # Same as #other_node but can return a none wrapped node
81
95
  def _other_node(node)
82
- if node == start_node
83
- return end_node
84
- elsif node == end_node
85
- return start_node
96
+ s = _start_node
97
+ e = _end_node
98
+ if node == _start_node
99
+ return _end_node
100
+ elsif node == _end_node
101
+ return _start_node
86
102
  else
87
103
  raise "Node #{node.inspect} is neither start nor end node"
88
104
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha.5
4
+ version: 3.0.0.alpha.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-05 00:00:00.000000000 Z
11
+ date: 2014-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty