module Dashing

Constants

VERSION

Attributes

configuration[RW]

Public Class Methods

config() click to toggle source
# File lib/dashing.rb, line 8
def config
  self.configuration ||= Configuration.new
end
configure() { |config| ... } click to toggle source
# File lib/dashing.rb, line 12
def configure
  yield config if block_given?
end
first_dashboard() click to toggle source
# File lib/dashing.rb, line 16
def first_dashboard
  files = Dir[config.dashboards_views_path.join('*')].collect { |f| File.basename(f, '.*') }
  files.sort.first
end
send_event(id, data) click to toggle source
# File lib/dashing.rb, line 21
def send_event(id, data)
  event = data.merge(id: id, updatedAt: Time.now.utc.to_i).to_json
  redis.with do |redis_connection|
    redis_connection.hset("#{Dashing.config.redis_namespace}.latest", id, event)
    redis_connection.publish("#{Dashing.config.redis_namespace}.create", event)
  end
end