Class: AnalyticsOps::Reports::Compatibility

Inherits:
Object
  • Object
show all
Defined in:
lib/analytics_ops/reports/metadata.rb,
sig/analytics_ops.rbs

Overview

Property-aware compatibility result for one immutable report definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_name:, dimensions:, metrics:) ⇒ Compatibility

Returns a new instance of Compatibility.



120
121
122
123
124
125
126
# File 'lib/analytics_ops/reports/metadata.rb', line 120

def initialize(report_name:, dimensions:, metrics:)
  @report_name = validate_name(report_name)
  @dimensions = normalize_entries(dimensions, "dimensions")
  @metrics = normalize_entries(metrics, "metrics")
  @compatible = (@dimensions + @metrics).all? { |entry| entry.fetch("compatibility") == "compatible" }
  freeze
end

Instance Attribute Details

#compatibleBoolean (readonly)

Returns the value of attribute compatible.

Returns:

  • (Boolean)


118
119
120
# File 'lib/analytics_ops/reports/metadata.rb', line 118

def compatible
  @compatible
end

#dimensionsArray[record] (readonly)

Returns the value of attribute dimensions.

Returns:

  • (Array[record])


118
119
120
# File 'lib/analytics_ops/reports/metadata.rb', line 118

def dimensions
  @dimensions
end

#metricsArray[record] (readonly)

Returns the value of attribute metrics.

Returns:

  • (Array[record])


118
119
120
# File 'lib/analytics_ops/reports/metadata.rb', line 118

def metrics
  @metrics
end

#report_nameString (readonly)

Returns the value of attribute report_name.

Returns:

  • (String)


118
119
120
# File 'lib/analytics_ops/reports/metadata.rb', line 118

def report_name
  @report_name
end

Instance Method Details

#to_hrecord

Returns:

  • (record)


128
129
130
131
132
133
134
135
# File 'lib/analytics_ops/reports/metadata.rb', line 128

def to_h
  {
    "report_name" => report_name,
    "compatible" => compatible,
    "dimensions" => dimensions,
    "metrics" => metrics
  }
end