lib/spnet/limiters/upper_limiter.rb
def apply_limit value, current_value = nil
    if inclusive
      if value <= @limit
        return value
      else
        return @limit
      end
    else
      if value < @limit
        return value
      else
        return @limit - Float::EPSILON
      end
    end
  end
# Limit the given value to be at or below @limit. Ignores the current_value parameter.
Limit the given value to be at or below @limit. Ignores the current_value parameter.
Limit the given value to be at or below @limit . Ignores the current_value parameter .
def apply_limit value, current_value = nil
    if inclusive
      if value <= @limit
        return value
      else
        return @limit
      end
    else
      if value < @limit
        return value
      else
        return @limit - Float::EPSILON
      end
    end
  end
def apply_limit value , current_value = nil if inclusive if value <= @limit return value else return @limit end else if value < @limit return value else return @limit - Float :: EPSILON end end end
Limit the given value to be at or below @limit.
Limit the given value to be at or below @limit .
value
current_value