diff options
author | Zachary Salzbank <zsalzbank@gmail.com> | 2013-04-29 20:49:02 -0300 |
---|---|---|
committer | pushmatrix <daniel.beauchamp@gmail.com> | 2013-05-09 22:07:39 +0200 |
commit | 8ad8097ed22cb557a2b5d946d11158575e82cb94 (patch) | |
tree | 8839e2296510f02bda72b88484a888c34a67addf /lib | |
parent | 50c8638f95584dbd863de6da042755ea400ee40b (diff) |
allow send_event to be called from within modules
resolves the error:
undefined local variable or method `settings'
when send_event is called from in a module
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dashing.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dashing.rb b/lib/dashing.rb index 949cfee..952b614 100644 --- a/lib/dashing.rb +++ b/lib/dashing.rb @@ -92,8 +92,8 @@ def send_event(id, body) body[:id] = id body[:updatedAt] ||= Time.now.to_i event = format_event(body.to_json) - settings.history[id] = event - settings.connections.each { |out| out << event } + Sinatra::Application.settings.history[id] = event + Sinatra::Application.settings.connections.each { |out| out << event } end def format_event(body) |