Class: DTAS::TrimFX::TFXSort

Inherits:
Struct
  • Object
show all
Defined in:
lib/dtas/trimfx.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



83
84
85
# File 'lib/dtas/trimfx.rb', line 83

def idx
  @idx
end

#tfxObject

Returns the value of attribute tfx

Returns:

  • (Object)

    the current value of tfx



83
84
85
# File 'lib/dtas/trimfx.rb', line 83

def tfx
  @tfx
end

Instance Method Details

#<=>(other) ⇒ Object



84
85
86
87
# File 'lib/dtas/trimfx.rb', line 84

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