Class: ClowderCommonRuby::LoggingConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::LoggingConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Attribute Summary collapse
-
#cloudwatch ⇒ Object
Returns the value of attribute cloudwatch.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ LoggingConfig
constructor
A new instance of LoggingConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ LoggingConfig
Returns a new instance of LoggingConfig.
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/clowder-common-ruby/types.rb', line 68 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 @cloudwatch = CloudWatchConfig.new(attributes.fetch(:cloudwatch, {})) end |
Instance Attribute Details
#cloudwatch ⇒ Object
Returns the value of attribute cloudwatch.
66 67 68 |
# File 'lib/clowder-common-ruby/types.rb', line 66 def cloudwatch @cloudwatch end |
Instance Method Details
#valid_keys ⇒ Object
80 81 82 83 84 85 |
# File 'lib/clowder-common-ruby/types.rb', line 80 def valid_keys [].tap do |keys| keys << :type keys << :cloudwatch end end |