Class: NoSE::QueryGraph::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/nose/query_graph.rb

Overview

A single node in a query graph

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity) ⇒ Node

Returns a new instance of Node.



12
13
14
# File 'lib/nose/query_graph.rb', line 12

def initialize(entity)
  @entity = entity
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity.



10
11
12
# File 'lib/nose/query_graph.rb', line 10

def entity
  @entity
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

Two nodes are equal if they represent the same entity



23
24
25
# File 'lib/nose/query_graph.rb', line 23

def ==(other)
  other.is_a?(Node) && @entity == other.entity
end

#hashObject



28
29
30
# File 'lib/nose/query_graph.rb', line 28

def hash
  @entity.name.hash
end

#inspectObject

:nocov:



17
18
19
# File 'lib/nose/query_graph.rb', line 17

def inspect
  @entity.name
end