Sha256: d31f5daa3748829a81eb436185b8b77be6581f2e80c10bbc8ec1f2789a301343
Contents?: true
Size: 587 Bytes
Versions: 4
Compression:
Stored size: 587 Bytes
Contents
require "json" module Salus class << self @@_discovers = {} def discover(name, &block) raise ArgumentError, "Block should be given" unless block_given? @@_discovers[name] = block end def discovers @@_discovers end def discovery(name) return unless @@_discovers.key?(name) data = [] @@_discovers[name].call(data) {data: data}.to_json end reset = instance_method(:reset) define_method(:reset) do reset.bind(self).() @@_discovers = {} nil end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
salus-0.2.1 | lib/salus/zabbix.rb |
salus-0.2.0 | lib/salus/zabbix.rb |
salus-0.1.3 | lib/salus/zabbix.rb |
salus-0.1.2 | lib/salus/zabbix.rb |