Class: ClowderCommonRuby::DeploymentMetadata

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ DeploymentMetadata

Returns a new instance of DeploymentMetadata.



117
118
119
120
121
122
123
124
125
126
# File 'lib/clowder-common-ruby/types.rb', line 117

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



128
129
130
131
132
133
# File 'lib/clowder-common-ruby/types.rb', line 128

def valid_keys
  [].tap do |keys|
    keys << :name
    keys << :image
  end
end