Class: ClowderCommonRuby::DependencyEndpointV2
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::DependencyEndpointV2
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ DependencyEndpointV2
constructor
A new instance of DependencyEndpointV2.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ DependencyEndpointV2
Returns a new instance of DependencyEndpointV2.
484 485 486 487 488 489 490 491 492 493 |
# File 'lib/clowder-common-ruby/types.rb', line 484 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 end |
Instance Method Details
#valid_keys ⇒ Object
495 496 497 498 499 500 501 |
# File 'lib/clowder-common-ruby/types.rb', line 495 def valid_keys [].tap do |keys| keys << :uri keys << :ca_certificate keys << :authenticated end end |