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 Method Summary (collapse)

Methods included from Mirror

#initialize, #name

Methods included from Mirror::ClassMethods

#included, #mirror_class, #reflect, #reflect!, #reflects?, #register_mirror

Instance Method Details

- (FieldMirror) class_variables

Returns the class variables of the object or its class

Returns:

  • (FieldMirror)

    the class variables of the object or its class

Raises:



13
14
15
# File 'lib/abstract_reflection/object_mirror.rb', line 13

def class_variables
  raise CapabilitiesExceeded
end

- (Object) instance_eval

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

- (Array<ObjectMirror>) objects_with_references

Searches the system for other objects that have references to this one.

Returns:



26
27
# File 'lib/abstract_reflection/object_mirror.rb', line 26

def objects_with_references
end

- (Array<ObjectMirror>, NilClass) path_to(obj)

Searches for a reference path from this object to another given object.

Returns:

  • (Array<ObjectMirror>, NilClass)

    the object path or nil, if none



40
41
# File 'lib/abstract_reflection/object_mirror.rb', line 40

def path_to(obj)
end

- (Class) target_class

Returns the actual runtime class object

Returns:

  • (Class)

    the actual runtime class object

Raises:



18
19
20
# File 'lib/abstract_reflection/object_mirror.rb', line 18

def target_class
  raise CapabilitiesExceeded
end

- (Hash<ObjectMirror => Hash<...,...>>) transitive_closure

Returns the transitive closure (the full object tree under this object, without duplicates).

Returns:



33
34
# File 'lib/abstract_reflection/object_mirror.rb', line 33

def transitive_closure
end

- (FieldMirror) variables

Returns the instance variables of the object

Returns:

  • (FieldMirror)

    the instance variables of the object

Raises:



8
9
10
# File 'lib/abstract_reflection/object_mirror.rb', line 8

def variables
  raise CapabilitiesExceeded
end