https://github.com/mrcsparker/mash
JSON object mash
https://github.com/mrcsparker/mash
Last synced: 2 months ago
JSON representation
JSON object mash
- Host: GitHub
- URL: https://github.com/mrcsparker/mash
- Owner: mrcsparker
- License: mit
- Created: 2014-03-25T04:29:09.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-28T15:43:36.000Z (about 11 years ago)
- Last Synced: 2025-02-14T02:23:06.226Z (4 months ago)
- Language: CoffeeScript
- Size: 250 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## mash
Create javascript models easily using JSON
*not much to see here right now*
## license
MIT
## written in
coffeescript
### example
Examples are in coffeescript right now.
```coffeescript
class Vendor extends Mash.Model
hasMany: -> [
Product
]
fullName: ->
this.name + ' : ' + this.addressclass Product extends Mash.Model
belongsTo: -> [
Vendor
]
fullPrice: ->
this.quantity * this.unit_priceproduct = new Product()
product.json jsonTextconsole.log product.vendor.fullName()
vendor = new Vendor()
vendor.json jsonTextconsole.log vendor.products[0].fullPrice()
```
#### Also check out
* https://github.com/meltingice/node-activerecord
* https://github.com/FineLinePrototyping/angularjs-rails-resource