Class: ClowderCommonRuby::DependencyEndpoint

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ DependencyEndpoint

Returns a new instance of DependencyEndpoint.



391
392
393
394
395
396
397
398
399
400
# File 'lib/clowder-common-ruby/types.rb', line 391

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_keysObject



402
403
404
405
406
407
408
409
410
# File 'lib/clowder-common-ruby/types.rb', line 402

def valid_keys
  [].tap do |keys|
    keys << :name
    keys << :hostname
    keys << :port
    keys << :app
    keys << :tlsPort
  end
end