I have a C# method that I need to call from a piece of Ruby that requires a System.Type argument. Is there a Ruby equivalent to typeof in C#? The call will look something like this in C# ...
var CustomClasInstance = Container.GetInstance(typeof(ICustomClass))
In addition to checking Object#class (the instance method class on the Object aka Base class), you could
s.is_a? Thing
this will check to see if s has Thing anywhere in its ancestry.
1.4m articles
1.4m replys
5 comments
56.9k users