Class: Settis::BooleanSerializer
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Serializer
for, inherited, #initialize
Class Method Details
.serializes?(type) ⇒ Boolean
19
20
21
|
# File 'lib/settis/serializers/boolean.rb', line 19
def self.serializes?(type)
type == :boolean
end
|
Instance Method Details
#deserialize(value) ⇒ Object
27
28
29
|
# File 'lib/settis/serializers/boolean.rb', line 27
def deserialize(value)
value != 'false' unless value.nil?
end
|
#serialize(value) ⇒ Object
23
24
25
|
# File 'lib/settis/serializers/boolean.rb', line 23
def serialize(value)
(value != false).to_s unless value.nil?
end
|