Class: ClowderCommonRuby::DependencyEndpoint

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ DependencyEndpoint

Returns a new instance of DependencyEndpoint.



403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/clowder-common-ruby/types.rb', line 403

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

#apiPathsObject

Returns the value of attribute apiPaths.



401
402
403
# File 'lib/clowder-common-ruby/types.rb', line 401

def apiPaths
  @apiPaths
end

Instance Method Details

#valid_keysObject



418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/clowder-common-ruby/types.rb', line 418

def valid_keys
  [].tap do |keys|
    keys << :name
    keys << :hostname
    keys << :port
    keys << :app
    keys << :tlsPort
    keys << :h2cPort
    keys << :h2cTLSPort
    keys << :tlsCAPath
    keys << :apiPath
    keys << :apiPaths
  end
end