Skip to content

CoffeeCup provides inheritable utilities for CoffeeScript classes.

Notifications You must be signed in to change notification settings

tcmacdonald/coffee_cup

Repository files navigation

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!

About

CoffeeCup provides inheritable utilities for CoffeeScript classes.

Resources

Stars

Watchers

Forks

Packages

No packages published