Class: DataMapper::Is::Serialized::Filters::BooleanSerializeFilter
- Inherits:
-
SerializeFilter
- Object
- SerializeFilter
- DataMapper::Is::Serialized::Filters::BooleanSerializeFilter
- Defined in:
- lib/dm-is-serialized/is/filters.rb
Overview
serialize: true => 1, false => 0
Instance Attribute Summary
Attributes inherited from SerializeFilter
Instance Method Summary collapse
Methods inherited from SerializeFilter
Instance Method Details
#deserialize(data) ⇒ Object
25 26 27 |
# File 'lib/dm-is-serialized/is/filters.rb', line 25 def deserialize(data) data.to_i == 1 end |
#serialize(data) ⇒ Object
21 22 23 |
# File 'lib/dm-is-serialized/is/filters.rb', line 21 def serialize(data) data ? 1 : 0 end |