Class: ClowderCommonRuby::LoggingConfig

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/clowder-common-ruby/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cloudwatchObject

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_keysObject



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