Fill in vertex base methods
This commit is contained in:
parent
66c9fd45d6
commit
f9e55a8f9d
@ -12,6 +12,7 @@ module VagrantPlugins
|
||||
autoload :Output, Vagrant.source_root.join("plugins/commands/serve/mappers/internal/graph/vertex/output").to_s
|
||||
autoload :Root, Vagrant.source_root.join("plugins/commands/serve/mappers/internal/graph/vertex/root").to_s
|
||||
autoload :Value, Vagrant.source_root.join("plugins/commands/serve/mappers/internal/graph/vertex/value").to_s
|
||||
|
||||
# @return [Object] value of vertex
|
||||
attr_reader :value
|
||||
|
||||
@ -42,6 +43,15 @@ module VagrantPlugins
|
||||
value
|
||||
end
|
||||
|
||||
def ==(v)
|
||||
v.hash_code == hash_code
|
||||
end
|
||||
alias_method :eql?, :==
|
||||
|
||||
def hash
|
||||
hash_code.to_s.chars.map(&:ord).sum.hash
|
||||
end
|
||||
|
||||
def to_s
|
||||
"<Vertex value=#{value} hash=#{hash_code}>"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user