Created
July 3, 2011 21:31
-
-
Save francescoagati/1062627 to your computer and use it in GitHub Desktop.
an example of private method in coffeescript with body class writable style ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal | |
private_method= -> 1+1 | |
@::sum= -> private_method() | |
dog=new Animal() | |
alert dog.sum() | |
class Fish extends Animal | |
delfin=new Fish() | |
alert delfin.sum() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment