Class: AnalyticsOps::Configuration::Document
- Inherits:
-
Object
- Object
- AnalyticsOps::Configuration::Document
- Defined in:
- lib/analytics_ops/configuration/document.rb,
sig/analytics_ops.rbs
Overview
Immutable collection of validated named profiles.
Instance Attribute Summary collapse
-
#profiles ⇒ Hash[String, DesiredState]
readonly
Returns the value of attribute profiles.
-
#version ⇒ Integer
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(version:, profiles:) ⇒ Document
constructor
A new instance of Document.
- #profile(name) ⇒ DesiredState
Constructor Details
Instance Attribute Details
#profiles ⇒ Hash[String, DesiredState] (readonly)
Returns the value of attribute profiles.
9 10 11 |
# File 'lib/analytics_ops/configuration/document.rb', line 9 def profiles @profiles end |
#version ⇒ Integer (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'lib/analytics_ops/configuration/document.rb', line 9 def version @version end |
Instance Method Details
#profile(name) ⇒ DesiredState
17 18 19 20 21 22 |
# File 'lib/analytics_ops/configuration/document.rb', line 17 def profile(name) profiles.fetch(name.to_s) do available = profiles.keys.sort.join(", ") raise ConfigurationError, "Unknown profile #{name.inspect}; available profiles: #{available}" end end |