Class: Cyrel::Types::SymbolType

Inherits:
ActiveModel::Type::Value
  • Object
show all
Defined in:
lib/cyrel/types/symbol_type.rb

Overview

inherits low‑overhead base

Instance Method Summary collapse

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