Class: ExistClient::Reporter
- Inherits:
-
Object
- Object
- ExistClient::Reporter
- Defined in:
- lib/exist_client/reporter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data_path ⇒ Object
readonly
Returns the value of attribute data_path.
-
#plugin ⇒ Object
readonly
Returns the value of attribute plugin.
-
#report_period ⇒ Object
readonly
Returns the value of attribute report_period.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(report_period) ⇒ Reporter
constructor
A new instance of Reporter.
Constructor Details
#initialize(report_period) ⇒ Reporter
Returns a new instance of Reporter.
16 17 18 19 20 |
# File 'lib/exist_client/reporter.rb', line 16 def initialize(report_period) @report_period = report_period @plugin = Config.plugin_for(self.class) @data_path = Config.data_path_for(self.class) end |
Instance Attribute Details
#data_path ⇒ Object (readonly)
Returns the value of attribute data_path.
3 4 5 |
# File 'lib/exist_client/reporter.rb', line 3 def data_path @data_path end |
#plugin ⇒ Object (readonly)
Returns the value of attribute plugin.
3 4 5 |
# File 'lib/exist_client/reporter.rb', line 3 def plugin @plugin end |
#report_period ⇒ Object (readonly)
Returns the value of attribute report_period.
3 4 5 |
# File 'lib/exist_client/reporter.rb', line 3 def report_period @report_period end |
Class Method Details
.metric_name ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/exist_client/reporter.rb', line 8 def self.metric_name str = name.split("::").last str.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2') str.gsub!(/([a-z\d])([A-Z])/, '\1_\2') str.tr!("-", "_") str.downcase! end |
.setup ⇒ Object
5 6 |
# File 'lib/exist_client/reporter.rb', line 5 def self.setup end |