Class: AnalyticsOps::Reports::FieldList
- Inherits:
-
Object
- Object
- AnalyticsOps::Reports::FieldList
- Defined in:
- lib/analytics_ops/reports/metadata.rb,
sig/analytics_ops.rbs
Overview
Immutable search result with enough context for human and JSON output.
Instance Attribute Summary collapse
-
#fields ⇒ Array[Field]
readonly
Returns the value of attribute fields.
-
#kind ⇒ String?
readonly
Returns the value of attribute kind.
-
#property_id ⇒ String
readonly
Returns the value of attribute property_id.
-
#query ⇒ String?
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(property_id:, query:, kind:, fields:) ⇒ FieldList
constructor
A new instance of FieldList.
- #to_h ⇒ record
Constructor Details
#initialize(property_id:, query:, kind:, fields:) ⇒ FieldList
Returns a new instance of FieldList.
77 78 79 80 81 82 83 |
# File 'lib/analytics_ops/reports/metadata.rb', line 77 def initialize(property_id:, query:, kind:, fields:) @property_id = property_id.dup.freeze @query = query&.dup&.freeze @kind = kind&.dup&.freeze @fields = fields.dup.freeze freeze end |
Instance Attribute Details
#fields ⇒ Array[Field] (readonly)
Returns the value of attribute fields.
75 76 77 |
# File 'lib/analytics_ops/reports/metadata.rb', line 75 def fields @fields end |
#kind ⇒ String? (readonly)
Returns the value of attribute kind.
75 76 77 |
# File 'lib/analytics_ops/reports/metadata.rb', line 75 def kind @kind end |
#property_id ⇒ String (readonly)
Returns the value of attribute property_id.
75 76 77 |
# File 'lib/analytics_ops/reports/metadata.rb', line 75 def property_id @property_id end |
#query ⇒ String? (readonly)
Returns the value of attribute query.
75 76 77 |
# File 'lib/analytics_ops/reports/metadata.rb', line 75 def query @query end |
Instance Method Details
#to_h ⇒ record
85 86 87 88 89 90 91 92 |
# File 'lib/analytics_ops/reports/metadata.rb', line 85 def to_h { "property_id" => property_id, "query" => query, "kind" => kind, "fields" => fields.map(&:to_h) } end |