V1.3: Data Types
Data types are available for custom entities schema, which are completely optional.
We have 5 data types:
- Definition - base type definition
- Strict - strict type with primitive type check
- Coercible - type with constructor that applies a coercion to given input
- Form - type with constructor that applies a non-strict coercion, specific to HTTP params
- JSON - type with constructor that applies a non-strict coercion, specific to JSON
Definition
Types::NilTypes::StringTypes::SymbolTypes::IntTypes::FloatTypes::DecimalTypes::ClassTypes::BoolTypes::TrueTypes::FalseTypes::DateTypes::DateTimeTypes::TimeTypes::ArrayTypes::Hash
Strict
Types::Strict::NilTypes::Strict::StringTypes::Strict::SymbolTypes::Strict::IntTypes::Strict::FloatTypes::Strict::DecimalTypes::Strict::ClassTypes::Strict::BoolTypes::Strict::TrueTypes::Strict::FalseTypes::Strict::DateTypes::Strict::DateTimeTypes::Strict::TimeTypes::Strict::ArrayTypes::Strict::Hash
Coercible
Types::Coercible::StringTypes::Coercible::IntTypes::Coercible::FloatTypes::Coercible::DecimalTypes::Coercible::ArrayTypes::Coercible::Hash
Form
Types::Form::NilTypes::Form::IntTypes::Form::FloatTypes::Form::DecimalTypes::Form::BoolTypes::Form::TrueTypes::Form::FalseTypes::Form::DateTypes::Form::DateTimeTypes::Form::TimeTypes::Form::ArrayTypes::Form::Hash
JSON
Types::Json::NilTypes::Json::DecimalTypes::Json::DateTypes::Json::DateTimeTypes::Json::TimeTypes::Json::ArrayTypes::Json::Hash
Hanami model data types are based on dry-types gem. Learn more at: http://dry-rb.org/gems/dry-types