neo4j-wrapper 0.0.3-java → 0.0.4-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,7 @@ module Neo4j
48
48
  # @example
49
49
  # Person.find(:since => (1.year.ago .. Time.now))
50
50
  # @see http://rdoc.info/github/andreasronge/neo4j-core/Neo4j/Core/Index/Indexer#find-instance_method Neo4j::Core::Index::ClassMethods#find
51
- def find(*query_params)
51
+ def find(*query_params, &block)
52
52
  query = query_params.first
53
53
  if query.is_a?(Hash)
54
54
  query.each_pair do |k, v|
@@ -57,7 +57,7 @@ module Neo4j
57
57
  query[k] = value
58
58
  end
59
59
  end
60
- _orig_find(*query_params)
60
+ _orig_find(*query_params, &block)
61
61
  end
62
62
 
63
63
  end
@@ -50,14 +50,13 @@ module Neo4j
50
50
 
51
51
  # Loads a wrapped node from the database given a neo id.
52
52
  # @param [#to_i, nil] neo_id
53
- # @raise an exception if the loaded node/relationship is not of the same kind as this class.
54
53
  # @return [Object, nil] If the node does not exist it will return nil otherwise the loaded node or wrapped node.
54
+ # @note it will return nil if the node returned is not kind of this class
55
55
  def load_entity(neo_id)
56
56
  node = Neo4j::Node.load(neo_id)
57
57
  return nil if node.nil?
58
58
  return node if node.class == Neo4j::Node
59
- raise "Expected loaded node #{neo_id} to be of type #{self} but it was #{node.class}" unless node.kind_of?(self)
60
- node
59
+ node.kind_of?(self) ? node : nil
61
60
  end
62
61
 
63
62
  end
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Wrapper
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
@@ -27,5 +27,5 @@ It comes included with the Apache Lucene document database.
27
27
  s.extra_rdoc_files = %w( README.rdoc )
28
28
  s.rdoc_options = ["--quiet", "--title", "Neo4j.rb", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
29
29
 
30
- s.add_dependency("neo4j-core", "0.0.7")
30
+ s.add_dependency("neo4j-core", "0.0.8")
31
31
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: neo4j-wrapper
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: java
7
7
  authors:
8
8
  - Andreas Ronge
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-08 00:00:00 Z
13
+ date: 2012-04-13 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: neo4j-core
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.0.7
23
+ version: 0.0.8
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  description: |