Class: Sensu::Plugins::Prometheus::Checks::Namespace

Inherits:
Object
  • Object
show all
Defined in:
lib/sensu/plugins/prometheus/checks/namespace.rb

Overview

Helper to transform a hash into local methods.

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Namespace

Returns a new instance of Namespace.



7
8
9
10
11
# File 'lib/sensu/plugins/prometheus/checks/namespace.rb', line 7

def initialize(hash)
  hash.each do |key, value|
    singleton_class.send(:define_method, key) { value }
  end
end

Instance Method Details

#namespace_bindingObject

Wrap around ‘binding` method.



14
15
16
# File 'lib/sensu/plugins/prometheus/checks/namespace.rb', line 14

def namespace_binding
  binding
end