Class: Mirrors::ObjectMirror
- Defined in:
- lib/mirrors/object_mirror.rb
Overview
A mirror class. It is the most generic mirror and should be able to reflect on any object you can get at in a given system.
Direct Known Subclasses
Instance Method Summary collapse
-
#target_class ⇒ ClassMirror
The a class mirror on the runtime class object.
-
#variables ⇒ FieldMirror
The instance variables of the object.
Methods inherited from Mirror
#initialize, #mirrors?, #name, #reflectee, #subject_id
Constructor Details
This class inherits a constructor from Mirrors::Mirror
Instance Method Details
#target_class ⇒ ClassMirror
Returns the a class mirror on the runtime class object.
11 12 13 |
# File 'lib/mirrors/object_mirror.rb', line 11 def target_class Mirrors.reflect(@subject.class) end |
#variables ⇒ FieldMirror
Returns the instance variables of the object.
6 7 8 |
# File 'lib/mirrors/object_mirror.rb', line 6 def variables field_mirrors(@subject.instance_variables) end |