instance method positive?

Ruby on Rails 5.2.8.1

Since v5.2.8.1 Last seen in v5.2.8.1

Signature

positive?()

Returns true if the number is positive.

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

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

Defined in Numeric

Type at least 2 characters to search.

↑↓ navigate · open · esc close