From 8ad8097ed22cb557a2b5d946d11158575e82cb94 Mon Sep 17 00:00:00 2001 From: Zachary Salzbank Date: Mon, 29 Apr 2013 20:49:02 -0300 Subject: 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 --- lib/dashing.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3