Class: Cyrel::Types::SymbolType
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- Cyrel::Types::SymbolType
- Defined in:
- lib/cyrel/types/symbol_type.rb
Overview
inherits low‑overhead base
Instance Method Summary collapse
-
#cast(value) ⇒ Object
String/ Symbol → Symbol / nil.
-
#serialize(value) ⇒ Object
Symbol → String (for JSON, etc.).
Instance Method Details
#cast(value) ⇒ Object
String/ Symbol → Symbol / nil
8 9 |
# File 'lib/cyrel/types/symbol_type.rb', line 8 def cast(value) = value&.to_sym # Symbol → String (for JSON, etc.) |
#serialize(value) ⇒ Object
Symbol → String (for JSON, etc.)
10 |
# File 'lib/cyrel/types/symbol_type.rb', line 10 def serialize(value) = value.to_s |