Module: Neo4jr::ParamHelper

Defined in:
lib/neo4jr-social/param_helper.rb

Instance Method Summary collapse

Instance Method Details

#param_depthObject



16
17
18
# File 'lib/neo4jr-social/param_helper.rb', line 16

def param_depth
  (params.delete('depth') || 2).to_i
end

#param_directionObject



24
25
26
# File 'lib/neo4jr-social/param_helper.rb', line 24

def param_direction
  Neo4jr::Direction.from_string(params.delete('direction') || 'both')
end

#param_levelObject



20
21
22
# File 'lib/neo4jr-social/param_helper.rb', line 20

def param_level 
  @param_level ||= (params.delete('level') || 1).to_i
end

#param_node_idObject



4
5
6
# File 'lib/neo4jr-social/param_helper.rb', line 4

def param_node_id
  params.delete('node_id')
end

#param_relationship_typeObject



8
9
10
# File 'lib/neo4jr-social/param_helper.rb', line 8

def param_relationship_type
  @param_relationship_type ||= params.delete('type')
end

#param_to_node_idObject



12
13
14
# File 'lib/neo4jr-social/param_helper.rb', line 12

def param_to_node_id
  params.delete('to')
end

#relationship_typesObject



28
29
30
# File 'lib/neo4jr-social/param_helper.rb', line 28

def relationship_types
  (param_relationship_type.nil? ? [] : [param_relationship_type].flatten.map {|name| DynamicRelationshipType.with_name(name)}).to_java(DynamicRelationshipType)
end