lib/openc3/conversions/segmented_polynomial_conversion.rb in openc3-5.18.0 vs lib/openc3/conversions/segmented_polynomial_conversion.rb in openc3-5.19.0

- old
+ new

@@ -15,11 +15,11 @@ # Modified by OpenC3, Inc. # All changes Copyright 2022, OpenC3, Inc. # All Rights Reserved # -# This file may also be used under the terms of a commercial license +# This file may also be used under the terms of a commercial license # if purchased from OpenC3, Inc. require 'openc3/conversions/conversion' module OpenC3 @@ -40,11 +40,11 @@ # @return [Array<Integer>] The polynomial coefficients attr_reader :coeffs # Creates a polynomial conversion segment. Multiple Segments are used to - # implemnt a {SegmentedPolynomialConversion}. + # implement a {SegmentedPolynomialConversion}. # # @param lower_bound [Integer] The value at which point this polynomial conversion # should apply. All values >= to this value will be converted using the # given coefficients. # @param coeffs [Array<Integer>] The polynomial coefficients @@ -58,19 +58,19 @@ # comes first. This makes the calculation code in call easier. # # @param other_segment [Segment] The segment to compare # @return [Integer] 1 if self.lower_bound > other_segment.lower_bound, 0 # if they are equal, -1 if self.lower_bound < other_segment.lower_bound - def <=>(other_segment) - return other_segment.lower_bound <=> @lower_bound + def <=>(other) + return other.lower_bound <=> @lower_bound end # Implement equality operator primarily for ease of testing # # @param segment [Segment] Other segment - def ==(other_segment) - @lower_bound == other_segment.lower_bound && - @coeffs == other_segment.coeffs + def ==(other) + @lower_bound == other.lower_bound && + @coeffs == other.coeffs end # Perform the polynomial conversion # # @param value [Numeric] The value to convert