Adding a method in the example

favorite_number is not declared in the example Class and can be misleading to people reading this.