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:



470
471
472
# File 'lib/shape_of.rb', line 470

def self.required?
  false
end

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

Returns:



465
466
467
468
# File 'lib/shape_of.rb', line 465

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