Class: ClowderCommonRuby::FeatureFlagsConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::FeatureFlagsConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ FeatureFlagsConfig
constructor
A new instance of FeatureFlagsConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ FeatureFlagsConfig
Returns a new instance of FeatureFlagsConfig.
347 348 349 350 351 352 353 354 355 356 |
# File 'lib/clowder-common-ruby/types.rb', line 347 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
358 359 360 361 362 363 364 365 |
# File 'lib/clowder-common-ruby/types.rb', line 358 def valid_keys [].tap do |keys| keys << :hostname keys << :port keys << :clientAccessToken keys << :scheme end end |