Class: NoSE::QueryGraph::Node
Overview
A single node in a query graph
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Two nodes are equal if they represent the same entity.
- #hash ⇒ Object
-
#initialize(entity) ⇒ Node
constructor
A new instance of Node.
-
#inspect ⇒ Object
:nocov:.
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
#entity ⇒ Object (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 |
#hash ⇒ Object
28 29 30 |
# File 'lib/nose/query_graph.rb', line 28 def hash @entity.name.hash end |
#inspect ⇒ Object
:nocov:
17 18 19 |
# File 'lib/nose/query_graph.rb', line 17 def inspect @entity.name end |