Class: ExistClient::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/exist_client/reporter.rb

Direct Known Subclasses

Tasks, TimeTracking

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_pathObject (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

#pluginObject (readonly)

Returns the value of attribute plugin.



3
4
5
# File 'lib/exist_client/reporter.rb', line 3

def plugin
  @plugin
end

#report_periodObject (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_nameObject



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

.setupObject



5
6
# File 'lib/exist_client/reporter.rb', line 5

def self.setup
end