Incorrect return value definition for infinite?

's Avatar

jason.mattingly

11 Jun, 2019 08:47 PM

https://www.rubydoc.info/stdlib/date/Date/Infinity#infinite%3F-inst...

This says that #infinite? ⇒ Boolean but it does not return a boolean. infinite? returns the results of .nonzero? which returns either self if nonzero or nil.

File 'lib/date.rb', line 20

def infinite? () d.nonzero? end

https://apidock.com/ruby/Numeric/nonzero%3F

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac