module Slnky

Constants

VERSION

Public Class Methods

brain() click to toggle source
# File lib/slnky/brain.rb, line 6
def brain
  Slnky::Brain::Base.instance
end
config() click to toggle source
# File lib/slnky/config.rb, line 11
def config
  Slnky::Config.instance
end
heartbeat(name) click to toggle source
# File lib/slnky.rb, line 24
def heartbeat(name)
  # server = ENV['SLNKY_URL'] || Slnky.config.url
  # RestClient.post "#{server}/hooks/heartbeat", {name: name}, content_type: :json, accept: :json
  Slnky.brain.hset(:heartbeat, name, Time.now.to_i)
end
log() click to toggle source
# File lib/slnky/log.rb, line 3
def log
  Slnky::Log.instance
end
notify(msg) click to toggle source
# File lib/slnky.rb, line 30
def notify(msg)
  server = self.config.url
  params = {name: msg.name, event: msg.to_h}
  RestClient.post "#{server}/hooks/notify", params.to_json, content_type: :json, accept: :json
end
version() click to toggle source
# File lib/slnky.rb, line 20
def version
  Slnky::VERSION
end