Class: ClowderCommonRuby::BrokerConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::BrokerConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Attribute Summary collapse
-
#sasl ⇒ Object
Returns the value of attribute sasl.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ BrokerConfig
constructor
A new instance of BrokerConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ BrokerConfig
Returns a new instance of BrokerConfig.
224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/clowder-common-ruby/types.rb', line 224 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 @sasl = KafkaSASLConfig.new(attributes.fetch(:sasl, {})) end |
Instance Attribute Details
#sasl ⇒ Object
Returns the value of attribute sasl.
222 223 224 |
# File 'lib/clowder-common-ruby/types.rb', line 222 def sasl @sasl end |
Instance Method Details
#valid_keys ⇒ Object
236 237 238 239 240 241 242 243 244 245 |
# File 'lib/clowder-common-ruby/types.rb', line 236 def valid_keys [].tap do |keys| keys << :hostname keys << :port keys << :cacert keys << :authtype keys << :sasl keys << :securityProtocol end end |