Sha256: 9f86f2196af3bb519a6b5f5ce3e1040ebae8507f9afb1d3b26bf86fc80c81c26

Contents?: true

Size: 695 Bytes

Versions: 11

Compression:

Stored size: 695 Bytes

Contents

module Neo4j
  module ToJava

    def type_to_java(type)
      org.neo4j.graphdb.DynamicRelationshipType.withName(type.to_s)
    end

    def dir_to_java(dir)
      case dir
        when :outgoing then org.neo4j.graphdb.Direction::OUTGOING
        when :both     then org.neo4j.graphdb.Direction::BOTH
        when :incoming then org.neo4j.graphdb.Direction::INCOMING
        else raise "unknown direction '#{dir}', expects :outgoing, :incoming or :both"
      end
    end
  end
end


org.neo4j.kernel.impl.core.IntArrayIterator.class_eval do
  def each_wrapped
    while(hasNext())
      yield self.next().wrapper
    end
  end

  def wrapped
    Enumerator.new(self, :each_wrapped)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
neo4j-1.0.0.beta.24-java lib/neo4j/to_java.rb
neo4j-1.0.0.beta.23-java lib/neo4j/to_java.rb
neo4j-1.0.0.beta.22-java lib/neo4j/to_java.rb
neo4j-1.0.0.beta.21-java lib/neo4j/to_java.rb
neo4j-1.0.0.beta.20 lib/neo4j/to_java.rb
neo4j-1.0.0.beta.19 lib/neo4j/to_java.rb
neo4j-1.0.0.beta.18 lib/neo4j/to_java.rb
neo4j-1.0.0.beta.17 lib/neo4j/to_java.rb
neo4j-1.0.0.beta.16 lib/neo4j/to_java.rb
neo4j-1.0.0.beta.15 lib/neo4j/to_java.rb
neo4j-1.0.0.beta.14 lib/neo4j/to_java.rb