Class: ClowderCommonRuby::InMemoryDBConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::InMemoryDBConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ InMemoryDBConfig
constructor
A new instance of InMemoryDBConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ InMemoryDBConfig
Returns a new instance of InMemoryDBConfig.
370 371 372 373 374 375 376 377 378 379 |
# File 'lib/clowder-common-ruby/types.rb', line 370 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
381 382 383 384 385 386 387 388 389 |
# File 'lib/clowder-common-ruby/types.rb', line 381 def valid_keys [].tap do |keys| keys << :hostname keys << :port keys << :username keys << :password keys << :sslMode end end |