When I look at an object (in the terminal or rails console), how can I determine if it is PORO or not?
I understand it means an object is just Ruby (does not rely on Rails). But I don't understand in a practical sense.
For example, when I print
#<AForm:0x007fdbf9b33468 @a=#<A id: 1,...
There's really no such thing as a "plain old Ruby object" as everything, literally everything is an object anyway, so there's no concept of "plain". How would you define non-plain?
If you want to know the class of an object:
If you want to know what this inherits from:
@a_form.superclass # Immediate parent @a_form.ancestors # All base classes and mixin modules
There are anonymous classes in Ruby, those made with
Class.new, and objects created with those are about as plain as you can get, but they're still first-class objects.