Class: ApplicationInsights::Channel::Contracts::MetricData
- Inherits:
-
JsonSerializable
- Object
- JsonSerializable
- ApplicationInsights::Channel::Contracts::MetricData
- Defined in:
- lib/application_insights/channel/contracts/metric_data.rb
Overview
Data contract class for type MetricData.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ MetricData
constructor
Initializes a new instance of the MetricData class.
-
#metrics ⇒ Object
Gets the metrics property.
-
#metrics=(value) ⇒ Object
Sets the metrics property.
-
#properties ⇒ Object
Gets the properties property.
-
#properties=(value) ⇒ Object
Sets the properties property.
-
#ver ⇒ Object
Gets the ver property.
-
#ver=(value) ⇒ Object
Sets the ver property.
Methods inherited from JsonSerializable
Constructor Details
#initialize(options = {}) ⇒ MetricData
Initializes a new instance of the MetricData class.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 9 def initialize(={}) defaults = { 'ver' => 2, 'metrics' => [], 'properties' => {} } values = { 'ver' => 2, 'metrics' => [] } super defaults, values, end |
Instance Method Details
#metrics ⇒ Object
Gets the metrics property.
33 34 35 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 33 def metrics @values['metrics'] end |
#metrics=(value) ⇒ Object
Sets the metrics property.
38 39 40 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 38 def metrics=(value) @values['metrics'] = value end |
#properties ⇒ Object
Gets the properties property.
43 44 45 46 47 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 43 def properties @values.fetch('properties') { @values['properties'] = {} } end |
#properties=(value) ⇒ Object
Sets the properties property.
50 51 52 53 54 55 56 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 50 def properties=(value) if value == @defaults['properties'] @values.delete 'properties' if @values.key? 'properties' else @values['properties'] = value end end |
#ver ⇒ Object
Gets the ver property.
23 24 25 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 23 def ver @values['ver'] end |
#ver=(value) ⇒ Object
Sets the ver property.
28 29 30 |
# File 'lib/application_insights/channel/contracts/metric_data.rb', line 28 def ver=(value) @values['ver'] = value end |