Class: DTAS::TFX::TFXSort

Inherits:
Struct
  • Object
show all
Defined in:
lib/dtas/tfx.rb

Overview

for stable sorting

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idxObject

Returns the value of attribute idx

Returns:

  • (Object)

    the current value of idx


89
90
91
# File 'lib/dtas/tfx.rb', line 89

def idx
  @idx
end

#tfxObject

Returns the value of attribute tfx

Returns:

  • (Object)

    the current value of tfx


89
90
91
# File 'lib/dtas/tfx.rb', line 89

def tfx
  @tfx
end

Instance Method Details

#<=>(other) ⇒ Object


90
91
92
93
# File 'lib/dtas/tfx.rb', line 90

def <=>(other)
  cmp = tfx <=> other.tfx
  0 == cmp ? idx <=> other.idx : cmp
end