Class: MetricsAdapter::Trackers::Base
- Inherits:
-
Object
- Object
- MetricsAdapter::Trackers::Base
- Defined in:
- lib/metrics_adapter/trackers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#conditional ⇒ Object
readonly
Returns the value of attribute conditional.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#extra_attributes ⇒ Object
readonly
Returns the value of attribute extra_attributes.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#metric_name ⇒ Object
readonly
Returns the value of attribute metric_name.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(event) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(event) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/metrics_adapter/trackers/base.rb', line 11 def initialize(event) adapter_name = MetricsAdapter.adapter.to_s.classify @adapter = "MetricsAdapter::Adapters::#{adapter_name}".constantize.new( MetricsAdapter. ) @event = event @extra_attributes = ::MetricsAdapter.extra_attributes @logger = ::MetricsAdapter.logger @metric_name = self.class.name.demodulize.underscore @conditional = ::MetricsAdapter.conditionals[@metric_name.to_sym] end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
4 5 6 |
# File 'lib/metrics_adapter/trackers/base.rb', line 4 def adapter @adapter end |
#conditional ⇒ Object (readonly)
Returns the value of attribute conditional.
4 5 6 |
# File 'lib/metrics_adapter/trackers/base.rb', line 4 def conditional @conditional end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
4 5 6 |
# File 'lib/metrics_adapter/trackers/base.rb', line 4 def event @event end |
#extra_attributes ⇒ Object (readonly)
Returns the value of attribute extra_attributes.
4 5 6 |
# File 'lib/metrics_adapter/trackers/base.rb', line 4 def extra_attributes @extra_attributes end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/metrics_adapter/trackers/base.rb', line 4 def logger @logger end |
#metric_name ⇒ Object (readonly)
Returns the value of attribute metric_name.
4 5 6 |
# File 'lib/metrics_adapter/trackers/base.rb', line 4 def metric_name @metric_name end |
Instance Method Details
#call ⇒ Object
23 24 25 |
# File 'lib/metrics_adapter/trackers/base.rb', line 23 def call raise NotImplementedError end |