Class: ShapeOf::Shape

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

Overview

Generic shape which all shapes subclass from

Direct Known Subclasses

Any, Array, Hash, Nothing, Optional, Pattern, Union

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShape

Returns a new instance of Shape.

Raises:

  • (NotImplementedError)


213
214
215
# File 'lib/shape_of.rb', line 213

def initialize(*)
  raise NotImplementedError
end

Class Method Details

.required?Boolean

Returns:



209
210
211
# File 'lib/shape_of.rb', line 209

def self.required?
  true
end

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

Returns:

Raises:

  • (NotImplementedError)


205
206
207
# File 'lib/shape_of.rb', line 205

def self.shape_of?(object, validator: Validator.new(shape: self, object: object))
  raise NotImplementedError
end