Class: ClowderCommonRuby::PrivateDependencyEndpoint
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::PrivateDependencyEndpoint
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ PrivateDependencyEndpoint
constructor
A new instance of PrivateDependencyEndpoint.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ PrivateDependencyEndpoint
Returns a new instance of PrivateDependencyEndpoint.
328 329 330 331 332 333 334 335 336 337 |
# File 'lib/clowder-common-ruby/types.rb', line 328 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| raise "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
339 340 341 342 343 344 345 346 |
# File 'lib/clowder-common-ruby/types.rb', line 339 def valid_keys [].tap do |keys| keys << :name keys << :hostname keys << :port keys << :app end end |