Method: Numeric#positive?

Defined in:
lib/extra_lib/core_ext/numeric.rb

#positive?Boolean

Checks whether a number is positive. Here we will consider zero as being a positive number.

Example: 5.positive? #=> true

Returns: True or false

Returns:

  • (Boolean)


21
22
23
# File 'lib/extra_lib/core_ext/numeric.rb', line 21

def positive?
	self >= 0
end