Class: Hawkular::Metrics::MetricDefinition
- Inherits:
-
BaseObject
- Object
- BaseObject
- Hawkular::Metrics::MetricDefinition
- Defined in:
- lib/hawkular/metrics/types.rb
Instance Attribute Summary collapse
-
#data_retention ⇒ Object
Returns the value of attribute data_retention.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
Attributes inherited from BaseObject
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(json = nil) ⇒ MetricDefinition
constructor
A new instance of MetricDefinition.
Constructor Details
#initialize(json = nil) ⇒ MetricDefinition
Returns a new instance of MetricDefinition
19 20 21 22 23 24 25 26 |
# File 'lib/hawkular/metrics/types.rb', line 19 def initialize(json = nil) super(json) unless json.nil? # rubocop:disable Style/GuardClause @tenant_id = @json['tenantId'] @data_retention = @json['dataRetention'] @tags = @json['tags'] end end |
Instance Attribute Details
#data_retention ⇒ Object
Returns the value of attribute data_retention
17 18 19 |
# File 'lib/hawkular/metrics/types.rb', line 17 def data_retention @data_retention end |
#tags ⇒ Object
Returns the value of attribute tags
17 18 19 |
# File 'lib/hawkular/metrics/types.rb', line 17 def @tags end |
#tenant_id ⇒ Object
Returns the value of attribute tenant_id
17 18 19 |
# File 'lib/hawkular/metrics/types.rb', line 17 def tenant_id @tenant_id end |
Instance Method Details
#hash ⇒ Object
28 29 30 31 32 33 |
# File 'lib/hawkular/metrics/types.rb', line 28 def hash h = { id: @id, tenantId: @tenant_id, dataRetention: @data_retention, tags: @tags } h.delete_if { |_k, v| v.nil? } h end |