Class: ClowderCommonRuby::ObjectStoreConfig
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::ObjectStoreConfig
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Attribute Summary collapse
-
#buckets ⇒ Object
Returns the value of attribute buckets.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ObjectStoreConfig
constructor
A new instance of ObjectStoreConfig.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ ObjectStoreConfig
Returns a new instance of ObjectStoreConfig.
316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/clowder-common-ruby/types.rb', line 316 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 @buckets = [] attributes.fetch(:buckets, []).each do |attr| @buckets << ObjectStoreBucket.new(attr) end end |
Instance Attribute Details
#buckets ⇒ Object
Returns the value of attribute buckets.
314 315 316 |
# File 'lib/clowder-common-ruby/types.rb', line 314 def buckets @buckets end |
Instance Method Details
#valid_keys ⇒ Object
331 332 333 334 335 336 337 338 339 340 |
# File 'lib/clowder-common-ruby/types.rb', line 331 def valid_keys [].tap do |keys| keys << :buckets keys << :accessKey keys << :secretKey keys << :hostname keys << :port keys << :tls end end |