instance method negative?

Ruby on Rails 5.2.8.1

Since v5.2.8.1 Last seen in v5.2.8.1

Signature

negative?()

Returns true if the number is negative.

-1.negative? # => true
0.negative?  # => false
1.negative?  # => false
Source
# File activesupport/lib/active_support/core_ext/numeric/inquiry.rb, line 19
    def negative?
      self < 0
    end

Defined in activesupport/lib/active_support/core_ext/numeric/inquiry.rb line 19 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Numeric

Type at least 2 characters to search.

↑↓ navigate · open · esc close