[Ironruby-core] Error on Names documentation page

Shay Friedman lists at ruby-forum.com
Sat Jun 13 04:11:19 EDT 2009


Sure.

C#:
public class Something
{
  public static Create()
  {
    Console.WriteLine("Creating Something");
    return new Something();
  }

  public Something()
  {
  }
}

IR:
class SomeSomething < Something
  def self.create
    puts "Creating SomeSomething!"
    super
  end
end

SomeSomething.create
# prints "Creating SomeSomething!
#         Creating Something"

If the IR method was named self.Create (with a capital C), the next will 
happen:
SomeSomething.create
# prints "Creating Something"

Thanks,
Shay.
----------------------------
Shay Friedman
http://www.ironshay.com
Follow me: http://twitter.com/ironshay
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list