Class: ClowderCommonRuby::TopicConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::TopicConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ TopicConfig
constructor
A new instance of TopicConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ TopicConfig
Returns a new instance of TopicConfig.
242 243 244 245 246 247 248 249 250 251 |
# File 'lib/clowder-common-ruby/types.rb', line 242 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
253 254 255 256 257 258 |
# File 'lib/clowder-common-ruby/types.rb', line 253 def valid_keys [].tap do |keys| keys << :requestedName keys << :name end end |