Class: ClowderCommonRuby::DependencyEndpoint
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ClowderCommonRuby::DependencyEndpoint
- Defined in:
- lib/clowder-common-ruby/types.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ DependencyEndpoint
constructor
A new instance of DependencyEndpoint.
- #valid_keys ⇒ Object
Constructor Details
#initialize(attributes) ⇒ DependencyEndpoint
Returns a new instance of DependencyEndpoint.
305 306 307 308 309 310 311 312 313 314 |
# File 'lib/clowder-common-ruby/types.rb', line 305 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
316 317 318 319 320 321 322 323 |
# File 'lib/clowder-common-ruby/types.rb', line 316 def valid_keys [].tap do |keys| keys << :name keys << :hostname keys << :port keys << :app end end |