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

#reflection

Instance Method Summary collapse

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_variablesFieldMirror

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

#instance_evalObject

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_referencesArray<ObjectMirror>

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

#path_to(obj) ⇒ Array<ObjectMirror>, NilClass

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

#target_classClassMirror

Returns the a class mirror on the runtime class object.

Returns:

  • (ClassMirror)

    the a class mirror on the runtime class object

Raises:



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

def target_class
  raise CapabilitiesExceeded
end

#transitive_closureHash<ObjectMirror => Hash<...,...>>

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

#variablesFieldMirror

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