Class: ShapeOf::Nothing

Inherits:
Shape
  • Object
show all
Defined in:
lib/shape_of.rb

Overview

Only passes when the key does not exist in the Hash.

Class Method Summary collapse

Methods inherited from Shape

#initialize

Constructor Details

This class inherits a constructor from ShapeOf::Shape

Class Method Details

.required?Boolean

Returns:



472
473
474
# File 'lib/shape_of.rb', line 472

def self.required?
  false
end

.shape_of?(object, validator: Validator.new(shape: self, object: object)) ⇒ Boolean

Returns:



467
468
469
470
# File 'lib/shape_of.rb', line 467

def self.shape_of?(object, validator: Validator.new(shape: self, object: object))
  validator.add_error("key present when not allowed")
  false
end