Class: ClowderCommonRuby::DependencyEndpoint
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::DependencyEndpoint
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Attribute Summary collapse
-
#apiPaths ⇒ Object
Returns the value of attribute apiPaths.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ DependencyEndpoint
constructor
A new instance of DependencyEndpoint.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ DependencyEndpoint
Returns a new instance of DependencyEndpoint.
395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/clowder-common-ruby/types.rb', line 395 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 @apiPaths = [] attributes.fetch(:apiPaths, []).each do |attr| @apiPaths << attr end end |
Instance Attribute Details
#apiPaths ⇒ Object
Returns the value of attribute apiPaths.
393 394 395 |
# File 'lib/clowder-common-ruby/types.rb', line 393 def apiPaths @apiPaths end |
Instance Method Details
#valid_keys ⇒ Object
410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/clowder-common-ruby/types.rb', line 410 def valid_keys [].tap do |keys| keys << :name keys << :hostname keys << :port keys << :app keys << :tlsPort keys << :apiPath keys << :apiPaths end end |