Class: ClowderCommonRuby::KafkaSASLConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::KafkaSASLConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ KafkaSASLConfig
constructor
A new instance of KafkaSASLConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ KafkaSASLConfig
Returns a new instance of KafkaSASLConfig.
192 193 194 195 196 197 198 199 200 201 |
# File 'lib/clowder-common-ruby/types.rb', line 192 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
203 204 205 206 207 208 209 210 |
# File 'lib/clowder-common-ruby/types.rb', line 203 def valid_keys [].tap do |keys| keys << :username keys << :password keys << :securityProtocol keys << :saslMechanism end end |