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.



69
70
71
72
73
74
75
76
77
78
79
# File 'lib/clowder-common-ruby/types.rb', line 69

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.



67
68
69
# File 'lib/clowder-common-ruby/types.rb', line 67

def cloudwatch
  @cloudwatch
end

Instance Method Details

#valid_keysObject



81
82
83
84
85
86
# File 'lib/clowder-common-ruby/types.rb', line 81

def valid_keys
  [].tap do |keys|
    keys << :type
    keys << :cloudwatch
  end
end