Class: RubyAi::Search::Vertex

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_ai/search/vertex.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:) ⇒ Vertex

Returns a new instance of Vertex.



6
7
8
# File 'lib/ruby_ai/search/vertex.rb', line 6

def initialize(name:)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/ruby_ai/search/vertex.rb', line 4

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
13
# File 'lib/ruby_ai/search/vertex.rb', line 10

def ==(other)
  self.class == other.class && 
  @name == other.name
end

#to_sObject



15
16
17
# File 'lib/ruby_ai/search/vertex.rb', line 15

def to_s
  "vertex: #{name}"
end