andreasronge/neo4j — Issue #152: Syntactical sugar..
Author: pehrlich
Created: 2012-02-02 06:17:20+00:00
State: open

..would ease the learning curve!

For example, I would argue:
- Every enum with a #first should have a #last
- just as there are rels and _rels, there should be _goals_rels, and goals_rels. (currently, only the ruby variant exists)
- rels and _rels should not take different arguments. (type, and dir & type, respectively)
- it is not clear that :type stands for the Ruby relationship class, symbolized and lower cased.
- Nor is it clear how one would use the rels or _rels method to look for rels from a named association! Indeed, the source itself uses "type" differently: @rel_type = "#{@target_class}##{@method_id}", which is misleading.

There are a few things that I can't tell if they are bugs or my own misunderstanding:

> u._rels.first.class
=> Neo4j::Relationship #ok
> u.rels.first.to_java.class
ArgumentError: wrong number of arguments (0 for 2) #not ok

There were some other issues I ran into, but I'll spare you the details.

Is there any way to get debugging insight on these "typeless classes"? It appears they are sometimes Java and sometimes Ruby, but I'm not certain.

> u.rels(:action).each {|r| p r.class.name}
"Neo4j::Relationship"
"Neo4j::Relationship"
=> [#<#:0x2b35b547>, #<#:0x53105e7a>]
u.rels(:action).each {|r| p r.inspect }
"#<#:0x2b35b547>"
"#<#:0x53105e7a>"
=> [#<#:0x2b35b547>, #<#:0x53105e7a>]