My Snippets

Ruby Class Example

class MyClass <  MySuperClass

  def self.language
    return "English"
  end

  def initialize
     @my_inst_var = "Philippe"
     @@my_class_var = "Hello"
  end

  def hello
    return @@my_class_var + @my_inst_var
  end

end

June 14th, 2008 Posted by | ruby | no comments

No Comments

No comments yet.

Sorry, the comment form is closed at this time.