Class: ClowderCommonRuby::PrometheusGatewayConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::PrometheusGatewayConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ PrometheusGatewayConfig
constructor
A new instance of PrometheusGatewayConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ PrometheusGatewayConfig
Returns a new instance of PrometheusGatewayConfig.
463 464 465 466 467 468 469 470 471 472 |
# File 'lib/clowder-common-ruby/types.rb', line 463 def initialize(attributes) super raise 'The input argument (attributes) must be a hash' if (!attributes || !attributes.is_a?(Hash)) attributes = attributes.each_with_object({}) do |(k, v), h| warn "The input [#{k}] is invalid" unless valid_keys.include?(k.to_sym) h[k.to_sym] = v end end |
Instance Method Details
#valid_keys ⇒ Object
474 475 476 477 478 479 |
# File 'lib/clowder-common-ruby/types.rb', line 474 def valid_keys [].tap do |keys| keys << :hostname keys << :port end end |