Class: ClowderCommonRuby::DatabaseConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::DatabaseConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ DatabaseConfig
constructor
A new instance of DatabaseConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ DatabaseConfig
Returns a new instance of DatabaseConfig.
263 264 265 266 267 268 269 270 271 272 |
# File 'lib/clowder-common-ruby/types.rb', line 263 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
274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/clowder-common-ruby/types.rb', line 274 def valid_keys [].tap do |keys| keys << :name keys << :username keys << :password keys << :hostname keys << :port keys << :adminUsername keys << :adminPassword keys << :rdsCa keys << :sslMode end end |