Module: Hashape

Defined in:
lib/hashape.rb

Overview

Provides utilities for checking the shape of deeply-nested hashes, such as for validating JSON.

Defined Under Namespace

Modules: Specifiers Classes: Shape, ShapeMatchError

Constant Summary collapse

VERSION =

The library version.

'2.0.0'

Class Method Summary collapse

Class Method Details

.shape(shape) ⇒ Shape

Create a new shape.

Parameters:

  • shape (Hash)

    The template hash.

Returns:

  • (Shape)

    The new shape.



116
117
118
# File 'lib/hashape.rb', line 116

def self.shape(shape)
  Shape.new(shape)
end