Skip to content
Browse files

better coffee namespace docs

  • Loading branch information...
1 parent 5432319 commit 2b3f2ef6ff216c542f0f3eb20b103aeed1c7ef48 @kristianmandrup committed
Showing with 21 additions and 0 deletions.
  1. +21 −0 README.rdoc
View
21 README.rdoc
@@ -344,6 +344,27 @@ Which will result in the statement:
Widgets.firstWidget.flashLight('action': 'search');
```
+An even better way...
+
+See [namespace.coffee](https://github.com/CodeCatalyst/namespace.coffee) for a good namespacing/package solution for coffee classes, as described in [oop coffee](http://www.gridlinked.info/oop-with-coffeescript-javascript/)
+
+```coffeescript
+namespace "samples.coffeescript.oop"
+ PetMaker :
+ class PetMaker
+ constructor : ->
+
+ createDog : (name) -> new Dog(name)
+ createCat : (name) -> new Cat(name)
+ createBird: (name) -> new Bird(name)
+
+ # private variable declarations (aliases)
+ #
+ Dog = samples.coffeescript.oop.pets.Dog
+ Cat = samples.coffeescript.oop.pets.Cat
+ Bird= samples.coffeescript.oop.pets.Bird
+```
+
== Testing
Apotomo comes with its own test case and assertions to <b>build rock-solid web components</b>.

0 comments on commit 2b3f2ef

Please sign in to comment.
Something went wrong with that request. Please try again.