Module: ShapeOf

Defined in:
lib/shape_of.rb

Overview

And these fail: “‘ruby hash_shape.shape_of?({ foo: { inner_value: ’bar’ } }) # => false hash_shape.shape_of?({ value: 23 }) # => false hash_shape.shape_of?({ value: [23] }) # => false hash_shape.shape_of?({ value: [{}] }) # => false “‘

Defined Under Namespace

Modules: Assertions Classes: Any, Array, Hash, Nothing, Optional, Shape, Union

Constant Summary collapse

Numeric =
Union[Integer, Float, Rational, Complex].tap do |this|
  this.instance_variable_set(:@class_name, this.name.sub(/Union.*/, 'Numeric'))
end
Boolean =
Union[TrueClass, FalseClass].tap do |this|
  this.instance_variable_set(:@class_name, this.name.sub(/Union.*/, 'Boolean'))
end