Class: Sensu::Plugins::Prometheus::Checks::Namespace
- Inherits:
-
Object
- Object
- Sensu::Plugins::Prometheus::Checks::Namespace
- Defined in:
- lib/sensu/plugins/prometheus/checks/namespace.rb
Overview
Helper to transform a hash into local methods.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Namespace
constructor
A new instance of Namespace.
-
#namespace_binding ⇒ Object
Wrap around ‘binding` method.
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_binding ⇒ Object
Wrap around ‘binding` method.
14 15 16 |
# File 'lib/sensu/plugins/prometheus/checks/namespace.rb', line 14 def namespace_binding binding end |