pathology

0.1.0 • Public • Published

Pathology

The scientific study of the nature of disease JavaScript and its causes, processes, development, and consequences.

Ember.js has AWESOME toString() support for objects. And I wanted some of that magic sauce. But I'm not ready to commit to Ember.js for the project I'm working on, there is just too much existing code.

Right now this only really does the following:

# Pathology = require "pathology" 
 
# One ugly-ish thing about pathology. 
# You've got to explicitly name your top-level 
# namespaces. Unlike Ember, Pathology isn't going 
# to go rooting around the global namespace looking 
# for your objects. 
Root = Pathology.Namespace.create("Root")
 
# However, Pathology doesn't need you to explicitly name 
# your further nested namespaces. As long as all your objects 
# are connected to a root level Namespace. 
# You can even reference your objects elsewhere for convenience. 
Subspace = Root.Subspace = Pathology.Namespace.create()
 
# Pathology provides a basic Object with extend/create semantics. 
Subspace.Thing = Pathology.Object.extend
  initialize: (@properties={}) ->
something = Subspace.Thing.create(property: "value")
 
# And this all comes together for the final awesome-sauce. 
puts Subspace.Thing.toString()
# => <Root.Subspace.Thing> 
puts something.toString()
# => <Root.Subspace.Thing __#-9> 

Rejoice in your debugging :D

Readme

Keywords

none

Package Sidebar

Install

npm i pathology

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • collintmiller