Class: Tito::Types::Json
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- Tito::Types::Json
- Defined in:
- lib/tito/types/json.rb
Instance Method Summary collapse
Instance Method Details
#cast(value) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/tito/types/json.rb', line 6 def cast(value) case value when Hash, Array then value when String then JSON.parse(value) when nil then nil else value end end |
#type ⇒ Object
4 |
# File 'lib/tito/types/json.rb', line 4 def type = :json |