Module: AbstractReflection::ObjectMirror
- Includes:
- Mirror
- Included in:
- ClassMirror, Ruby::Reflection::ObjectMirror
- Defined in:
- lib/abstract_reflection/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.
Instance Attribute Summary
Attributes included from Mirror
Instance Method Summary collapse
-
#class_variables ⇒ FieldMirror
The class variables of the object or its class.
-
#instance_eval ⇒ Object
The instance_eval known from Ruby.
-
#objects_with_references ⇒ Array<ObjectMirror>
Searches the system for other objects that have references to this one.
-
#path_to(obj) ⇒ Array<ObjectMirror>, NilClass
Searches for a reference path from this object to another given object.
-
#target_class ⇒ ClassMirror
The a class mirror on the runtime class object.
-
#transitive_closure ⇒ Hash<ObjectMirror => Hash<...,...>>
Returns the transitive closure (the full object tree under this object, without duplicates).
-
#variables ⇒ FieldMirror
The instance variables of the object.
Methods included from Mirror
#initialize, #mirrors?, #name, #reflectee
Methods included from Mirror::ClassMethods
#included, #mirror_class, #new, #reflect, #reflect!, #reflects?, #register_mirror
Instance Method Details
#class_variables ⇒ FieldMirror
Returns the class variables of the object or its class.
13 14 15 |
# File 'lib/abstract_reflection/object_mirror.rb', line 13 def class_variables raise CapabilitiesExceeded end |
#instance_eval ⇒ Object
The instance_eval known from Ruby. Should return the result or a representation thereof.
45 46 |
# File 'lib/abstract_reflection/object_mirror.rb', line 45 def instance_eval end |
#objects_with_references ⇒ Array<ObjectMirror>
Searches the system for other objects that have references to this one.
26 27 |
# File 'lib/abstract_reflection/object_mirror.rb', line 26 def objects_with_references end |
#path_to(obj) ⇒ Array<ObjectMirror>, NilClass
Searches for a reference path from this object to another given object.
40 41 |
# File 'lib/abstract_reflection/object_mirror.rb', line 40 def path_to(obj) end |
#target_class ⇒ ClassMirror
Returns the a class mirror on the runtime class object.
18 19 20 |
# File 'lib/abstract_reflection/object_mirror.rb', line 18 def target_class raise CapabilitiesExceeded end |
#transitive_closure ⇒ Hash<ObjectMirror => Hash<...,...>>
Returns the transitive closure (the full object tree under this object, without duplicates).
33 34 |
# File 'lib/abstract_reflection/object_mirror.rb', line 33 def transitive_closure end |
#variables ⇒ FieldMirror
Returns the instance variables of the object.
8 9 10 |
# File 'lib/abstract_reflection/object_mirror.rb', line 8 def variables raise CapabilitiesExceeded end |