Class: Kmeans::Pair
- Inherits:
-
Array
- Object
- Array
- Kmeans::Pair
- Defined in:
- lib/kmeans/pair.rb
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(*args) ⇒ Pair
constructor
A new instance of Pair.
- #original_eql? ⇒ Object
- #original_hash ⇒ Object
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: ==
13 14 15 |
# File 'lib/kmeans/pair.rb', line 13 def eql?(other) sort.original_eql?(other.sort) end |
#hash ⇒ Object
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_hash ⇒ Object
11 |
# File 'lib/kmeans/pair.rb', line 11 alias_method :original_hash, :hash |