Module: Sequent::Test::DateTimePatches::Compare

Included in:
DateTime, Time
Defined in:
lib/sequent/test/time_comparison.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object

omit nsec in datetime comparisons



18
19
20
21
22
23
24
# File 'lib/sequent/test/time_comparison.rb', line 18

def <=>(other)
  if other.is_a?(DateTimePatches::Normalize)
    precision = Sequent.configuration.time_precision
    return normalize.iso8601(precision) <=> other.normalize.iso8601(precision)
  end
  public_send(:'___<=>', other)
end

#___<=>Object

rubocop:disable Style/Alias



14
# File 'lib/sequent/test/time_comparison.rb', line 14

alias :'___<=>' :'<=>'