Module: Plumb::Types

Extended by:
TypeRegistry
Defined in:
lib/plumb/types.rb

Defined Under Namespace

Modules: Lax, URI, UUID Classes: Data

Constant Summary collapse

Any =
AnyClass.new
Never =
NeverClass.new
Undefined =
Any.value(Plumb::Undefined)
String =
Symbol =
Numeric =
Integer =
Float =
Decimal =
Static =
StaticClass.new
Value =
ValueClass.new
Nil =
True =
False =
Boolean =
(True | False).as_node(:boolean)
Array =
ArrayClass.new
Stream =
StreamClass.new
Tuple =
TupleClass.new
Hash =
HashClass.new
Range =
RangeClass.new
Not =
Plumb::Not.new
Interface =
InterfaceClass.new
Email =
String[URI::MailTo::EMAIL_REGEXP].as_node(:email)
Date =
Time =
SymbolizedHash =

A type that recursively converts string keys to symbols in nested hashes. This is commonly used for normalizing payload data in commands and events.

Examples:

Simple hash symbolization

SymbolizedHash.parse({ 'name' => 'John' })  # => { name: 'John' }

Nested hash symbolization

SymbolizedHash.parse({ 'user' => { 'name' => 'John' } })  # => { user: { name: 'John' } }

Mixed types preserved

SymbolizedHash.parse({ 'count' => 1, 'active' => true })  # => { count: 1, active: true }

Method Summary

Methods included from TypeRegistry

const_added, included