Class: NeoScout::GDB_Neo4j::Typer
- Includes:
- TyperValueTableMixin
- Defined in:
- lib/neoscout/gdb_neo4j.rb
Instance Attribute Summary collapse
-
#edge_mapper ⇒ Object
Returns the value of attribute edge_mapper.
-
#nil_type ⇒ Object
Returns the value of attribute nil_type.
-
#node_mapper ⇒ Object
Returns the value of attribute node_mapper.
-
#type_attr ⇒ Object
Returns the value of attribute type_attr.
-
#value_type_table ⇒ Object
Returns the value of attribute value_type_table.
Instance Method Summary collapse
- #checked_edge_type?(edge_type) ⇒ Boolean
- #checked_node_type?(node_type) ⇒ Boolean
- #edge_type(edge) ⇒ Object
-
#initialize ⇒ Typer
constructor
A new instance of Typer.
- #node_type(node) ⇒ Object
- #unknown_edge_type?(type) ⇒ Boolean
- #unknown_node_type?(type) ⇒ Boolean
Methods included from TyperValueTableMixin
Methods inherited from Typer
Constructor Details
#initialize ⇒ Typer
Returns a new instance of Typer.
33 34 35 36 37 38 39 |
# File 'lib/neoscout/gdb_neo4j.rb', line 33 def initialize @type_attr = '_classname' @nil_type = '__NOTYPE__' @node_mapper = nil @edge_mapper = nil @value_type_table = {} end |
Instance Attribute Details
#edge_mapper ⇒ Object
Returns the value of attribute edge_mapper.
29 30 31 |
# File 'lib/neoscout/gdb_neo4j.rb', line 29 def edge_mapper @edge_mapper end |
#nil_type ⇒ Object
Returns the value of attribute nil_type.
26 27 28 |
# File 'lib/neoscout/gdb_neo4j.rb', line 26 def nil_type @nil_type end |
#node_mapper ⇒ Object
Returns the value of attribute node_mapper.
28 29 30 |
# File 'lib/neoscout/gdb_neo4j.rb', line 28 def node_mapper @node_mapper end |
#type_attr ⇒ Object
Returns the value of attribute type_attr.
25 26 27 |
# File 'lib/neoscout/gdb_neo4j.rb', line 25 def type_attr @type_attr end |
#value_type_table ⇒ Object
Returns the value of attribute value_type_table.
27 28 29 |
# File 'lib/neoscout/gdb_neo4j.rb', line 27 def value_type_table @value_type_table end |
Instance Method Details
#checked_edge_type?(edge_type) ⇒ Boolean
53 |
# File 'lib/neoscout/gdb_neo4j.rb', line 53 def checked_edge_type?(edge_type) ; edge_type != self.nil_type end |
#checked_node_type?(node_type) ⇒ Boolean
52 |
# File 'lib/neoscout/gdb_neo4j.rb', line 52 def checked_node_type?(node_type) ; node_type != self.nil_type end |
#edge_type(edge) ⇒ Object
47 48 49 50 |
# File 'lib/neoscout/gdb_neo4j.rb', line 47 def edge_type(edge) type = edge.rel_type if type then edge_mapped(type.to_s) else @nil_type end end |
#node_type(node) ⇒ Object
41 42 43 44 45 |
# File 'lib/neoscout/gdb_neo4j.rb', line 41 def node_type(node) props = node.props return node_mapped(props[@type_attr]) if props.has_key? @type_attr @nil_type end |
#unknown_edge_type?(type) ⇒ Boolean
56 |
# File 'lib/neoscout/gdb_neo4j.rb', line 56 def unknown_edge_type?(type) ; type == @nil_type end |
#unknown_node_type?(type) ⇒ Boolean
55 |
# File 'lib/neoscout/gdb_neo4j.rb', line 55 def unknown_node_type?(type) ; type == @nil_type end |