Class: ClowderCommonRuby::PrivateDependencyEndpoint

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/clowder-common-ruby/types.rb

Instance Method Summary collapse

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_keysObject



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