class Hawkular::Metrics::MetricDefinition

Attributes

data_retention[RW]
tags[RW]
tenant_id[RW]

Public Class Methods

new(json = nil) click to toggle source
Calls superclass method Hawkular::Metrics::BaseObject::new
   # File lib/hawkular/metrics/types.rb
19 def initialize(json = nil)
20   super(json)
21   unless json.nil? # rubocop:disable Style/GuardClause
22     @tenant_id = @json['tenantId']
23     @data_retention = @json['dataRetention']
24     @tags = @json['tags']
25   end
26 end

Public Instance Methods

hash() click to toggle source
   # File lib/hawkular/metrics/types.rb
28 def hash
29   h = { id: @id, tenantId: @tenant_id,
30         dataRetention: @data_retention, tags: @tags }
31   h.delete_if { |_k, v| v.nil? }
32   h
33 end