Class: Kredis::Type::Json
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- Kredis::Type::Json
- Defined in:
- lib/kredis/type/json.rb
Instance Method Summary collapse
Instance Method Details
#cast_value(value) ⇒ Object
10 11 12 |
# File 'lib/kredis/type/json.rb', line 10 def cast_value(value) JSON.parse(value) end |
#serialize(value) ⇒ Object
14 15 16 |
# File 'lib/kredis/type/json.rb', line 14 def serialize(value) JSON.dump(value) end |
#type ⇒ Object
6 7 8 |
# File 'lib/kredis/type/json.rb', line 6 def type :json end |