Exception: SuperModel::Error::HashType
- Inherits:
-
Type
- Object
- StandardError
- SuperModel::Error
- Type
- SuperModel::Error::HashType
- Defined in:
- lib/super_model/error/hash_type.rb
Class Method Summary collapse
Methods inherited from Type
#to_s, valid_methods, valid_types
Class Method Details
.check(object, options = {}) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/super_model/error/hash_type.rb', line 8 def self.check(object, ={}) super raise self unless [:required_keys].is_a?(Array) && [:required_keys].all? { |key| object.has_key?(key) } object end |