26 Dec, 2008 in
Ruby by
khelll
This is the second post related to ruby’s reflection API, the previous post was an extensive intro to this topic. While the current one will be lighter somehow, it would require you to focus a bit more on the content.
Here we go:
Setting, getting and removing instance variables :
# Define a simple class M
class M ; [...]
I wanted to start blogging on ruby reflection api, but i just realized that i have to give a second part of my previous article on ruby introspection .
So here we go:
s = ”
# s.is_a? String, this is the same!
String === s
# Determines whether the object has a public or protected method with [...]
I’m pretty sure that you have heard lots about ruby, specially as being a dynamic language, you can create methods on the fly, add instance variables, define constants and invoke existing methods dynamically , and that’s what this post is all about :
As you know in ruby you can call a public instance method directly [...]
Hi, this is my first blog post!, i’m already done of reading this artilce on groovy’s lang introspection , and i wanted to submit the equivalent one for ruby, so all you need now is to fire your irb and follow me :
# Whats is your class?
a = 5
b = "Hello"
# Whats is [...]