Class: Kmeans::Pair

Inherits:
Array
  • Object
show all
Defined in:
lib/kmeans/pair.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Pair

Returns a new instance of Pair.


5
6
7
8
# File 'lib/kmeans/pair.rb', line 5

def initialize(*args)
  super
  slice!(2, (size - 2))
end

Instance Method Details

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

Returns:

  • (Boolean)

13
14
15
# File 'lib/kmeans/pair.rb', line 13

def eql?(other)
  sort.original_eql?(other.sort)
end

#hashObject


17
18
19
# File 'lib/kmeans/pair.rb', line 17

def hash
  sort.original_hash
end

#original_eql?Object


10
# File 'lib/kmeans/pair.rb', line 10

alias_method :original_eql?, :eql?

#original_hashObject


11
# File 'lib/kmeans/pair.rb', line 11

alias_method :original_hash, :hash