title: CoffeeScript Class Properties Within Nested Anonymous Functions
body: <p>I'm familiar with the hidden pattern methodology however I'm still wrapping my head around object prototypes. </p>
  
  <p>I'm trying to create a basic class for controlling a section on my site. The problem I'm running into is losing defined class variables within a different scope. For example, the code below works fine and creates the properties within the object perfectly. However when I jump into a jQuery callback I lose all knowledge of the class variables storing some of the jQuery objects for multiple uses.</p>
  
  <p>Is there a way to grab them from within the callback function?</p>
  
  <pre><code>class Session
      initBinds: -&gt;
          @loginForm.bind 'ajax:success', (data, status, xhr) -&gt;
              console.log("processed")
              return
          @loginForm.bind 'ajax:before', (xhr, settings) -&gt;
              console.log @loader // need access to Session.loader
              return
          return
      init: -&gt;
          @loginForm = $("form#login-form")
          @loader = $("img#login-loader")
          this.initBinds()
          return
  </code></pre>