Method: ICFS::Items.validate

Defined in:
lib/icfs/items.rb

.validate(obj, name, val) ⇒ Object

Validate an object

Parameters:

  • obj (Object)

    object to validate

  • name (String)

    description of the object

  • val (Hash)

    the check to use

Raises:



76
77
78
79
80
81
82
# File 'lib/icfs/items.rb', line 76

def self.validate(obj, name, val)
  err = Validate.check(obj, val)
  if err
    raise(Error::Value, '%s has bad values: %s' %
      [name, err.inspect])
  end
end