Class: Ruby::Reflection::InstanceVariableMirror

Inherits:
FieldMirror show all
Defined in:
lib/ruby/reflection/field_mirror/instance_variable_mirror.rb

Instance Attribute Summary

Attributes included from AbstractReflection::Mirror

#reflection

Instance Method Summary collapse

Methods inherited from FieldMirror

#initialize, mirror_class, #name

Methods included from AbstractReflection::FieldMirror

#delete, #writable?

Methods included from AbstractReflection::Mirror

#initialize, #mirrors?, #name, #reflectee

Methods included from AbstractReflection::Mirror::ClassMethods

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

Constructor Details

This class inherits a constructor from Ruby::Reflection::FieldMirror

Instance Method Details

#private?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ruby/reflection/field_mirror/instance_variable_mirror.rb', line 20

def private?
  true
end

#protected?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ruby/reflection/field_mirror/instance_variable_mirror.rb', line 16

def protected?
  false
end

#public?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ruby/reflection/field_mirror/instance_variable_mirror.rb', line 12

def public?
  false
end

#valueObject



4
5
6
# File 'lib/ruby/reflection/field_mirror/instance_variable_mirror.rb', line 4

def value
  reflection.reflect @object.instance_variable_get(@name)
end

#value=(o) ⇒ Object



8
9
10
# File 'lib/ruby/reflection/field_mirror/instance_variable_mirror.rb', line 8

def value=(o)
  @object.instance_variable_set(@name, o)
end