Class: Mayu::Metrics::Reporter::DataStore

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mayu/metrics/reporter.rb

Defined Under Namespace

Classes: MetricStore

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDataStore

Returns a new instance of DataStore.



153
154
155
# File 'lib/mayu/metrics/reporter.rb', line 153

def initialize
  @store = T.let(init_metric_hash, MetricHash)
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



150
151
152
# File 'lib/mayu/metrics/reporter.rb', line 150

def store
  @store
end

Instance Method Details

#for_metric(metric_name, metric_type:, metric_settings: {}) ⇒ Object



164
165
166
167
168
169
170
171
# File 'lib/mayu/metrics/reporter.rb', line 164

def for_metric(metric_name, metric_type:, metric_settings: {})
  MetricStore.new(
    T.must(@store[metric_name]),
    metric_name:,
    metric_type:,
    metric_settings:
  )
end