Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

rubyworks/mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mirror

Gem Version Build Status     Flattr Me

Homepage / Documentation / Support / Source Code

There is a problem in the realm of Ruby metaprogramming" objects can be liars. You see, there is no guaruntee that the return value of a method is the "truth". Any object can play dirty tricks.

string = "Watch this..."

def string.class
  nil
end

string.class  #=> nil

We are never going to know what the mirror class of that object is by asking it. So what can we do?

I've decided I could at least provide my own library that provides some of the functionality.

require 'mirror'

Mirror[string].class  #=> String

Installation

Putting the old RubyGems to work:

$ gem install mirror

Copyrights

Real is copyrighted open source software.

Copyright (c) 2012 Rubyworks (BSD-2-Clause)

You many redistribute or modify this work in accordance with the BSD-2-Clause license.

See LICENSE.txt for details.

About

True Refelection on Ruby Objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages