module Neo4j::ToJava

Public Instance Methods

dir_from_java(dir) click to toggle source
# File lib/neo4j/to_java.rb, line 8
def dir_from_java(dir)
  case dir
    when org.neo4j.graphdb.Direction::OUTGOING then :outgoing
    when org.neo4j.graphdb.Direction::BOTH     then :both
    when org.neo4j.graphdb.Direction::INCOMING then :incoming
    else raise "unknown direction '#{dir} / #{dir.class}'"
  end
end
dir_to_java(dir) click to toggle source
# File lib/neo4j/to_java.rb, line 17
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
type_to_java(type) click to toggle source
# File lib/neo4j/to_java.rb, line 4
def type_to_java(type)
  org.neo4j.graphdb.DynamicRelationshipType.withName(type.to_s)
end