class Mirrors::ConstantMirror
Public Instance Methods
delete()
click to toggle source
# File lib/mirrors/field_mirror/constant_mirror.rb, line 30 def delete @object.send(:remove_const, @name) end
private?()
click to toggle source
# File lib/mirrors/field_mirror/constant_mirror.rb, line 26 def private? false end
protected?()
click to toggle source
# File lib/mirrors/field_mirror/constant_mirror.rb, line 22 def protected? false end
public?()
click to toggle source
# File lib/mirrors/field_mirror/constant_mirror.rb, line 18 def public? true end
value()
click to toggle source
# File lib/mirrors/field_mirror/constant_mirror.rb, line 3 def value if path = @object.autoload?(@name) unless $LOADED_FEATURES.include?(path) || $LOADED_FEATURES.include?(File.expand_path(path)) # Do not trigger autoload return nil end end Mirrors.reflect @object.const_get(@name) end
value=(o)
click to toggle source
# File lib/mirrors/field_mirror/constant_mirror.rb, line 14 def value=(o) @object.const_set(@name, o) end