Created
December 26, 2011 05:31
-
-
Save cmer/1520576 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Feed | |
fetch: -> | |
url = "http://example.org/feed?x=1" | |
url += "&ts=#{@oldest_item}" if @oldest_item | |
$.getJSON url, (data) -> | |
@oldest_item = data.oldest_item | |
# do something else with data | |
# How can I set a class variable from an anonymous function? For example, @oldest_item on line 4 is always null. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment