Naming conventions

Ruby defines some naming conventions for its variable, method, constant and class.

  • Constant: Starts with a capital letter.
  • Global variable: Starts with a dollar sign ($).
  • Instance variable: Starts with a (@) sign.
  • Class variable: Starts with a (@@) sign.
  • Method name: Allowed to start with a capital letter.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *