Sha256: e9f821658b187c3801691eaee271d6af39bc3ffb4d48b56472d36444be203d9a

Contents?: true

Size: 806 Bytes

Versions: 25

Compression:

Stored size: 806 Bytes

Contents

module Hawkular
  module Metrics
    class BaseObject
      attr_reader :json
      attr_accessor :id

      def initialize(json)
        @json = json
        @id = @json['id'] unless json.nil?
      end
    end

    class Tenant < BaseObject
    end

    class MetricDefinition < BaseObject
      attr_accessor :tenant_id, :data_retention, :tags

      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

      def hash
        h = { id: @id, tenantId: @tenant_id,
              dataRetention: @data_retention, tags: @tags }
        h.delete_if { |_k, v| v.nil? }
        h
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hawkular-client-5.0.0 lib/hawkular/metrics/types.rb
hawkular-client-5.0.0.pre2 lib/hawkular/metrics/types.rb
hawkular-client-5.0.0.pre1 lib/hawkular/metrics/types.rb
hawkular-client-4.1.0 lib/hawkular/metrics/types.rb
hawkular-client-4.0.0 lib/hawkular/metrics/types.rb
hawkular-client-3.0.2 lib/hawkular/metrics/types.rb
hawkular-client-3.0.1 lib/hawkular/metrics/types.rb
hawkular-client-3.0.0 lib/hawkular/metrics/types.rb
hawkular-client-2.9.0 lib/hawkular/metrics/types.rb
hawkular-client-2.8.0 lib/hawkular/metrics/types.rb
hawkular-client-2.7.0 lib/hawkular/metrics/types.rb
hawkular-client-2.6.0 lib/hawkular/metrics/types.rb
hawkular-client-2.5.0 lib/hawkular/metrics/types.rb
hawkular-client-2.4.0 lib/hawkular/metrics/types.rb
hawkular-client-2.3.0 lib/hawkular/metrics/types.rb
hawkular-client-2.2.1 lib/hawkular/metrics/types.rb
hawkular-client-2.2.0 lib/hawkular/metrics/types.rb
hawkular-client-2.1.0 lib/hawkular/metrics/types.rb
hawkular-client-2.0.0 lib/hawkular/metrics/types.rb
hawkular-client-1.0.0 lib/hawkular/metrics/types.rb