Project

coffee_cup

0.0
No commit activity in last 3 years
No release in over 3 years
CoffeeCup provides inheritable utilities for CoffeeScript classes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

CoffeeCup provides inheritable utilities for CoffeeScript classes under Rails 3.2

Usage

Include CoffeeCup in your Gemfile.

gem "coffee_cup"

Include CoffeeCup in your application.js manifest file.

//= require coffee_cup

Extend CoffeeCup in your own classes.

class window.Testing extends CoffeeCup

  default_options:
    name: 'Frank'

  init: ->
    # Initialize stuff here

  welcome: ->
    @log "Welcome #{@options.name}!"

Instantiate your objects like normal.

$ -> 
  
  test = new Testing( { debug: true, name: "Bob" } )
  test.welcome()

  # outputs the following...
  # Testing.log > Welcome Bob!