Class: Puppet::Util::Instrumentation::Data
- Extended by:
- Indirector
- Defined in:
- lib/vendor/puppet/util/instrumentation/data.rb
Overview
This is just a transport class to be used through the instrumentation_data indirection. All the data resides in the real underlying listeners which this class delegates to.
Constant Summary
Constants included from Indirector
Instance Attribute Summary collapse
-
#listener ⇒ Object
readonly
Returns the value of attribute listener.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(listener_name) ⇒ Data
constructor
A new instance of Data.
- #name ⇒ Object
- #to_pson(*args) ⇒ Object
Methods included from Indirector
Constructor Details
#initialize(listener_name) ⇒ Data
Returns a new instance of Data.
14 15 16 17 |
# File 'lib/vendor/puppet/util/instrumentation/data.rb', line 14 def initialize(listener_name) @listener = Puppet::Util::Instrumentation[listener_name] raise "Listener #{listener_name} wasn't registered" unless @listener end |
Instance Attribute Details
#listener ⇒ Object (readonly)
Returns the value of attribute listener.
12 13 14 |
# File 'lib/vendor/puppet/util/instrumentation/data.rb', line 12 def listener @listener end |
Class Method Details
.from_pson(data) ⇒ Object
31 32 33 |
# File 'lib/vendor/puppet/util/instrumentation/data.rb', line 31 def self.from_pson(data) data end |
Instance Method Details
#name ⇒ Object
19 20 21 |
# File 'lib/vendor/puppet/util/instrumentation/data.rb', line 19 def name @listener.name end |
#to_pson(*args) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/vendor/puppet/util/instrumentation/data.rb', line 23 def to_pson(*args) result = { 'document_type' => "Puppet::Util::Instrumentation::Data", 'data' => { :name => name }.merge(@listener.respond_to?(:data) ? @listener.data : {}) } result.to_pson(*args) end |