Module: Neo4jr::ParamHelper
- Defined in:
- lib/neo4jr-social/param_helper.rb
Instance Method Summary collapse
- #param_depth ⇒ Object
- #param_direction ⇒ Object
- #param_level ⇒ Object
- #param_node_id ⇒ Object
- #param_relationship_type ⇒ Object
- #param_to_node_id ⇒ Object
- #relationship_types ⇒ Object
Instance Method Details
#param_depth ⇒ Object
16 17 18 |
# File 'lib/neo4jr-social/param_helper.rb', line 16 def param_depth (params.delete('depth') || 2).to_i end |
#param_direction ⇒ Object
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_level ⇒ Object
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_id ⇒ Object
4 5 6 |
# File 'lib/neo4jr-social/param_helper.rb', line 4 def param_node_id params.delete('node_id') end |
#param_relationship_type ⇒ Object
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_id ⇒ Object
12 13 14 |
# File 'lib/neo4jr-social/param_helper.rb', line 12 def param_to_node_id params.delete('to') end |
#relationship_types ⇒ Object
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 |