Is everything in ruby an object? Does this include Fixnum
s?
Depends on what you mean by "everything". Fixnum
s are, as the others have demonstrated. Classes also are, as instances of class Class
. Methods, operators and blocks aren't, but can be wrapped by objects (Proc
). Simple assignment is not, and can't. Statements like while
also aren't and can't. Comments obviously also fall in the latter group.
Most things that actually matter, i.e. that you would wish to manipulate, are objects (or can be wrapped in objects).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With