Class: AnalyticsOps::Reports::Compatibility
- Inherits:
-
Object
- Object
- AnalyticsOps::Reports::Compatibility
- 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
-
#compatible ⇒ Boolean
readonly
Returns the value of attribute compatible.
-
#dimensions ⇒ Array[record]
readonly
Returns the value of attribute dimensions.
-
#metrics ⇒ Array[record]
readonly
Returns the value of attribute metrics.
-
#report_name ⇒ String
readonly
Returns the value of attribute report_name.
Instance Method Summary collapse
-
#initialize(report_name:, dimensions:, metrics:) ⇒ Compatibility
constructor
A new instance of Compatibility.
- #to_h ⇒ record
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
#compatible ⇒ Boolean (readonly)
Returns the value of attribute compatible.
118 119 120 |
# File 'lib/analytics_ops/reports/metadata.rb', line 118 def compatible @compatible end |
#dimensions ⇒ Array[record] (readonly)
Returns the value of attribute dimensions.
118 119 120 |
# File 'lib/analytics_ops/reports/metadata.rb', line 118 def dimensions @dimensions end |
#metrics ⇒ Array[record] (readonly)
Returns the value of attribute metrics.
118 119 120 |
# File 'lib/analytics_ops/reports/metadata.rb', line 118 def metrics @metrics end |
#report_name ⇒ String (readonly)
Returns the value of attribute report_name.
118 119 120 |
# File 'lib/analytics_ops/reports/metadata.rb', line 118 def report_name @report_name end |
Instance Method Details
#to_h ⇒ 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 |