neo4j-java-driver 0.3.5-java → 0.4.0-java

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
  SHA256:
3
- metadata.gz: 866688516c97a667d7f2a4a6e02f80b500a63adc4dbc2ba1b12fd56b2261d840
4
- data.tar.gz: a466a394747f26a3304762a98bb2a197632756340c3fa41f47deae6345927c99
3
+ metadata.gz: 0d15a30347713fb80742a8abc60472a20dd240dc327dc7b5ec48e69e128810e7
4
+ data.tar.gz: a276cf844d3a0a1b5c3b977744aedd8e74634d7a0e9c1829addb334d7e19d825
5
5
  SHA512:
6
- metadata.gz: aba8b8646b15c048c1bf81b96af2acd3a1631221169edacc9beab7d1b6ca4f74e507a3bbec3873ffa7358ef705ea4a0b9088178b99a393d14af702b9b0c18d53
7
- data.tar.gz: a9909b50278aa1330a93b30af06fde0f14f9f41d83fce4364fd59ca0be952d146f8c5bf69008508db1e036225086841f1e7d6ccea13e8f623521dc8bb34b54ac
6
+ metadata.gz: 7afbfb75c3268db498e5a5ec0a8b64b664e4fc0121f395e97448338e4fbce30fd80dc5341b951465063056f0ad2f7119faba49410cce2440a4733ffaa4cbda9a
7
+ data.tar.gz: 960124acd456ee2a9fb4f3edd2d0c9bc816b3929792a926a5397d13bbcf814932a6d813b5e2fd81be4694fcb25ddf055293dcfa085e6ef2fe490e6287695e033
@@ -9,6 +9,8 @@ module Neo4j
9
9
  module Driver
10
10
  include_package 'org.neo4j.driver.v1'
11
11
 
12
+ Record = Java::OrgNeo4jDriverInternal::InternalRecord
13
+ StatementResult = Java::OrgNeo4jDriverInternal::InternalStatementResult
12
14
  Transaction = Java::OrgNeo4jDriverInternal::ExplicitTransaction
13
15
 
14
16
  module Net
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Neo4j
4
+ module Driver
5
+ module Ext
6
+ module InternalKeys
7
+ include ExceptionCheckable
8
+
9
+ def keys
10
+ check { super.map(&:to_sym) }
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -4,12 +4,20 @@ module Neo4j
4
4
  module Driver
5
5
  module Ext
6
6
  module InternalRecord
7
+ include MapConverter
8
+ include InternalKeys
9
+
7
10
  def values
8
11
  java_send(:values).map(&:as_ruby_object)
9
12
  end
10
13
 
11
- define_method(:[]) do |key|
12
- java_method(:get, [key.is_a?(Integer) ? Java::int : java.lang.String]).call(key).as_ruby_object
14
+ def [](key)
15
+ case key
16
+ when Integer
17
+ java_method(:get, [Java::int]).call(key)
18
+ else
19
+ java_method(:get, [java.lang.String]).call(key.to_s)
20
+ end.as_ruby_object
13
21
  end
14
22
 
15
23
  def first
@@ -6,8 +6,9 @@ module Neo4j
6
6
  module InternalStatementResult
7
7
  include Enumerable
8
8
  include ExceptionCheckable
9
+ include InternalKeys
9
10
 
10
- %i[has_next? next keys single consume summary peek].each do |method|
11
+ %i[has_next? next single consume summary peek].each do |method|
11
12
  define_method(method) do |*args, &block|
12
13
  check { super(*args, &block) }
13
14
  end
@@ -6,7 +6,7 @@ module Neo4j
6
6
  module MapAccessor
7
7
  include MapConverter
8
8
 
9
- alias properties to_hash
9
+ alias properties to_h
10
10
 
11
11
  def [](key)
12
12
  get(key.to_s).as_ruby_object
@@ -4,7 +4,7 @@ module Neo4j
4
4
  module Driver
5
5
  module Ext
6
6
  module MapConverter
7
- def to_hash
7
+ def to_h
8
8
  java_method(:asMap, [org.neo4j.driver.v1.util.Function]).call(&:itself).to_hash
9
9
  .transform_values!(&:as_ruby_object).symbolize_keys!
10
10
  end
@@ -11,7 +11,7 @@ module Neo4j
11
11
  when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::LIST
12
12
  values(&:itself).map(&:as_ruby_object)
13
13
  when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::MAP
14
- to_hash
14
+ to_h
15
15
  when Java::OrgNeo4jDriverInternalTypes::TypeConstructor::DATE
16
16
  date = as_local_date
17
17
  Date.new(date.year, date.month_value, date.day_of_month)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neo4j
4
4
  module Driver
5
- VERSION = '0.3.5'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-java-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: java
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -218,6 +218,7 @@ files:
218
218
  - jruby/neo4j/driver/ext/graph_database.rb
219
219
  - jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb
220
220
  - jruby/neo4j/driver/ext/internal_driver.rb
221
+ - jruby/neo4j/driver/ext/internal_keys.rb
221
222
  - jruby/neo4j/driver/ext/internal_node.rb
222
223
  - jruby/neo4j/driver/ext/internal_record.rb
223
224
  - jruby/neo4j/driver/ext/internal_relationship.rb