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.



395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/clowder-common-ruby/types.rb', line 395

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.



393
394
395
# File 'lib/clowder-common-ruby/types.rb', line 393

def apiPaths
  @apiPaths
end

Instance Method Details

#valid_keysObject



410
411
412
413
414
415
416
417
418
419
420
# File 'lib/clowder-common-ruby/types.rb', line 410

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